[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 uses <Var/Ware>.
<Var/Ware> = The ware you want to know, if it's used by <RefObj> as secondary resource.
This checks, if the as <RefObj> selected station uses the as <Var/Ware> selected ware as secondary resource.
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 -> uses ware $ware as secondary resource
||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 use that ware as secondary resource and store them in the array $station.ware.arr.
Related Commands:
<RetVar/IF><RefObj> uses ware <Var/Ware> as primary resource
Command Location:
- »» Trade Commands
- »» for Stations
<RetVar/IF><RefObj> uses ware <Var/Ware> as secondary resource
- »» for Stations