[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Use a variable, if the command should return information. If a variable is used, it will contain an array filled with the wares that can be bought in the selected sector.
<RefObj> = A variable containing a sector.
<Var/Number> = A TRUE or FALSE value or its representing number 1 or 0.
<Var/Number> = A TRUE or FALSE value or its representing number 1 or 0.
<Var/Number> = A TRUE or FALSE value or its representing number 1 or 0.
Returns all buyable wares in an array in the as <RefObj> selected sector. It can be specified, which wares the array should contain. By setting the additional values to TRUE, the wares array will contain products from player factories ( include playerfacts ), ships and stations ( include shipyards ) as well as wares from docks including softwares ( include docks ).
This command however just checks, which products are listed in the sector's stations. It will neither check, if the player can buy them (credits / rank / transport class requirements) nor if there are any wares currently in stock.
Example:
$ware=Energy Cells
$sector=[PLAYERSHIP] -> get sector
$buyable.wares.arr=$sector -> get buyable wares in sector: include playerfacs=[TRUE] include shipyards=[FALSE] include docks=[TRUE]
if find $ware in array: $buyable.wares.arr
|write to player logbook: printf: fmt='%s can be bought in sector %s.', $ware, $sector, null, null, null
end
return null
This will check, if Energy Cells are buyable in the current player sector and write an appropriate message to the logbook, if it's the case.
Command Location:
- »» Universe and Sector Commands
<RetVar/IF><RefObj> get buyable wares in sector: include playerfacts=<Var/Number> include shipyards=<Var/Number> include docks=<Var/Number>