[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Command return, with an 'if' statement used it will be TRUE (1) if condition passes or FALSE (0) if it fails, otherwise if you use a Variable it will be the task ID as an integer.
A further explanation of the "If" statement,
The 'if' statement is false, when it runs on task 0 (and maybe for global tasks? It is suspected they are task 0 as well), otherwise it will return "true" when task is 1+ (i.e. not main task, not global script).
Returns the current task's ID number.
Task zero is always the “main” task of an object.
When you give a normal navigation, combat, or trade command to a ship, for example, the script that carries out that order runs on task zero of the target object.
Tasks one through six run scripts for turrets one through six.
Tasks ten and eleven are used for the scripts that run from a ship's “additional ship commands” menu.
Tasks eleven to nineteen are used for Station Commands.
Task 33: turret weapon switching task of AI ships.
One way to find a free task is to ask the engine for the “next free task”.
The other way is to use the ID of your script's TFile. This already is a unique number in the 7000-9999 range so there will be no collisions.
If you need more than one, you can simply keep counting up. 7046, 17046, 27046...
Example:
$task.ID = get task ID
$task.ID will be an integer representing the scripts current task ID.
Command Location:
- »» General Commands
<RetVar/IF> = get task ID