[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = RetVar is if you want to save the return to a variable. IF will check to see if the ware is illegal in the specified races sectors and return True / False.
<Var/Ware> = The ware that you want to check to see if it is illegal or not.
<Var/Race> = The Race who's sectors you wish to check for legality.
This command will check to see if a particular ware is illegal in the specified races sectors.
Example:
You may wish to create a script something like this and asign it to a hotkey to be able to run a quick check on your target / personal ships cargo.
(assuming you already have the array $all.ships.cargo created somewhere else)
$target = get player tracking aim
if not $target is of class Ship
| $target = [PLAYERSHIP]
end
$sector = $target get sector
$sector.owner = $sector get owner race
(get the array $all.ships.cargo created somewhere else)
$size size of array $all.ships.cargo
$counter = 0
while $counter < $size
| $ware = $all.ships.cargo [$counter]
| |
| if is ware $ware illegal in $sector.owner sectors
| | $message = sprintf: fmt='%s is illegal in %s sectors.', $ware, $sector.owner, <Value>, <Value>, <Value>
| | display subtitle text: text=$message duration=3000 ms
| | @ wait 3000 ms
| end
| |
| @ wait 100 ms
| inc $counter
end
This will check all the wares in $all.ships.cargo and if any are illegal in your current sector you will get the subtitle message telling you.
Command Location:
- »» Trade Commands
<RetVar/IF> is ware <Var/Ware> illegal in <Var/Race> sectors