<RetVar> = A variable where the requested information is stored in an array.
<Var/Race> = A race or a variable containing it.
<Value> = A station class / type or 'null'.
This will return all existing stations by the as <Var/Race> selected race of the as <Value> selected class / type. Entering 'null' as class / type value will return all stations of the selected race.
Example:
$i=0
$sector.arr= array alloc: size=0
$player.sector=[PLAYERSHIP] -> get sector
$station.arr= get station array: of race Argon class/type=Shipyard
$size= size of array $station.arr
while $size
|dec $size=
|$station=$station.arr[$size]
|skip if $i > 0
||$shipyard=$station
|$sector=$station -> get sector
|$jumps= get jumps from sector $player.sector to sector $sector
|skip if $i > 0
||$range=$jumps
|if $jumps < $range
||$range=$jumps
||$shipyard=$station
|end
|inc $i=
end
write to player logbook $shipyard
return null
This gets all Argon shipyards in an array and finds out the jump distance between the shipyard's and the player sector. Afterwards it writes the nearest shipyard to the player logbook.
Related Commands:
<RetVar> = get station array: product=<Var/Ware> include empty=<Var/Boolean>
<RetVar> = get station array: resource=<Var/Ware> include empty=<Var/Boolean>
Command Location:
- »» Universe and Sector Commands
<RetVar> = get station array: of race <Var/Race> class/type=<Value>