<Var/String> = This is the Merchants name, what is displayed in the list of merchants at a Trading Station.
<RefObj> = The Trading Station you want this Merchant to appear at.
<Var/Array> = The array containing the list of wares this merchant wishes to buy.
<Var/Array> = The array containing the list of wares owned by this merchant.
<Var/Number> = The amount of credits this Merchant starts with.
This command adds a merchant to the barter list in trading stations.
The first string is the Merchants name, what is displayed in the list.
Base is the station they are at and wanted wares and owned wares are arrays of wares that they have.
The structure for the wanted and owned ware arrays, each ware is an array of 2 elements, ware and amount.
$wanted.ware.array = alloc array: size = 0
$ware = alloc array: size = 2
$ware = Energy Cells
$ware = 100
append $ware to array $wanted.ware.array
Then to add the merchant to the Trading Station,
add merchant $merchant.name base= $station wanted wares=$wanted.ware.array owned wares=$owned.ware.array cash=$credits
This will add the merchant $merchant.name to the Trading Station specified by $station with the owned and wanted wares in the ware arrays. The merchants credits will alter with their transactions but they will start with the amount you provide at $credits.
- »» Trade Commands
- »» Merchants
add merchant <Var/String> base= <RefObj> wanted wares= <Var/Array> owned wares= <Var/Array> cash= <Var/Number>
- »» Merchants