[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 1 on success and null on failure.
<RefObj> = The station you want to know, if it trades with <Var/Ware>.
<Var/Ware> = The ware you want to know, if <RefObj> trades with it.
This checks, if the as <RefObj> selected station trades with the as <Var/Ware> selected ware.
Example:
$station.ware.arr = array alloc: size=0
$sector = [PLAYERSHIP] -> get sector
$station.arr = $sector -> get station array from sector
$size = size of array $station.arr
while $size
|dec $size =
|$station = $station.arr[$size]
|if $station -> trades with ware $ware
||append $station to array $station.ware.arr
|end
end
return null
Assuming $ware contains a ware, this will get all stations in the current player's sector, which trade with that ware and store them in the array $station.ware.arr.
Related Commands:
<RetVar> = <RefObj> get tradeable ware array from station
Command Location:
- »» Trade Commands
- »» for Stations
<RetVar/IF><RefObj> trades with ware <Var/Ware>
- »» for Stations