Control Flow
The flow of actions may be controlled in a way similar to procedural programming.
There are sequences of actions, conditional branching, and variable assignments.
| Item type | Sequence |
| Description | a sequence of actions |
| Action | perform actions of the sequence |
| Condition | true, if performed |
| Key | Type | Default | Description |
| actions | [Actions] | | list of actions |
| loop | bool | 1 | if false, the sequence is only executed once, otherwise repeatedly |
| single | bool | 0 | if true, only one action is selected for execution, otherwise all |
| random | bool | 0 | if true, the order is randomly, otherwise as in the list |
The following table lists the meaning of all possible combinations of the flags
(cf. sequence example).
| loop | single | random | Meaning |
| true | true | true | each time, one random action is executed |
| true | true | false | each time, one action is executed according to the order;
after the last follows the first again |
| true | false | true | each time, one action is executed in random order;
the order of the list is random, but fixed until all items are executed once |
| true | false | false | each time, all actions are executed (default) |
| false | true | true | once, one random action is executed |
| false | true | false | each action is executed once in list order |
| false | false | true | each action is executed once in random order |
| false | false | false | once, all actions are executed |
Case
| Item type | Case |
| Description | A conditional branch. |
| Action | performs the action for the first true condition |
| Condition | true, if performed |
| Key | Type | Default | Description |
| conditions | [Conds] | | a list of conditions |
| actions | [Actions] | | a list of according actions |
| negation | value | 0 | negation flags |
When executed, the conditions are tested in the given order. For the first true condition,
the according action is executed. The action list must contain as many entries as the condition
list. The action list may contain an additional entry as default action.
Use negation flags to invert the truth of a condition. These are boolean flags and may negate up
to 16 conditions. You may use the constants in the definitions
for up to 4 conditions, if you are not familiar with boolean flags. Also, you may use the MS Windows
calculator in scientific mode and translate the flags from binary to decimal.
| Item type | Condition |
| Description | conditional branch |
| Action | one action depending on truth of condition |
| Condition | true, if performed |
| Key | Type | Default | Description |
| conditions | [Conds] | [] | a list of conditional items |
| true | Actions | <> | action to execute, if condition is true |
| false | Actions | <> | action to execute, if condition is false |
| or | bool | 0 | if true, one condition must be true, otherwise all |
| loop | bool | 0 | if true, the true condition is executed repeatedly until
the condition is false (avoid endless loops!) |
| negation | value | 0 | negation flags (see above: Case) |
Note: If the conditions are empty, the condition executes the false and the
true action alternate.
| Item type | SetCondition |
| Description | changes the state of a condition |
| Action | marks a condition as true or false |
| Condition | true, if performed |
| Key | Type | Default | Description |
| condition | Conds | | an item that may be used as a condition |
| true | bool | 0 | the state to set |
Usually, the conditional state of an item reflects a real state of the item.
Nonetheless, it may be useful sometimes to change this state explicitely. E.g.
one action may turn back the effect of another and thus the condition of the
latter may be reset to indicate that the effect is no longer valid.
| Item type | SetVariable |
| Description | sets a variable |
| Action | assigns a value to an item variable |
| Condition | true, if performed |
| Key | Type | Default | Description |
| variable | byte | | variable name |
| item | item | <> | new value of the variable |