[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 return 1 on success and null on failure.
<RefObj> = The station you want to check, if it sells <Var/Ware>.
<Var/Ware> = The ware you want to check, if it is sold by <RefObj>.
Checks, if the as <Var/Ware> selected ware is sold by the as <RefObj> selected station. This will not check, if the station has that ware in its cargo space.
Example:
$target = get player tracking aim
if $target -> can sell ware $ware
|$amount = $target -> get amount of ware $ware in cargo bay
|if $amount > 0
||$price = $target -> get price of ware $ware
||write to player logbook: printf: fmt='You can buy %s %s to a price of %s per unit at %s.', $amount, $ware, $price, $target, null
|end
end
return null
Assuming $ware contains a ware and the current player $target is a station, this will check, if that station sells that ware. It will also check if the station has the ware in its cargo space. If that's the case, an appropriate message will be written to the player logbook.
Related Commands:
<RetVar/IF><RefObj> can buy ware <Var/Ware>
Command Location:
- »» Trade Commands
- »» for Stations
<RetVar/IF><RefObj> can sell ware <Var/Ware>
- »» for Stations