[skip|else] if [not]|while [not]| = Possible 'conditional' statements that can be used.
<RetVar/IF> = variable where the requested information is put.
<RefObj> = The object you want to check.
If <RefObj> is docked, <RetVar/IF> will contain the carrier or station it is docked at, otherwise it returns the sector the object is in. If <RefObj> is invalid or doesn't exist, it will return null.
Alternatively, when the script is running on the object you want to check you can use the [ENVIRONMENT] constant.
Example:
$env = $ship -> get environment
$sector = $ship -> get sector
if $env = $sector
| write to logbook "the ship is flying"
else
| write to logbook "the ship is docked"
end
Command Location:
- »» General Object Commands
<RetVar/IF><RefObj> get environment