< Modification of items Index Interface commands >

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.

Sequence

Item typeSequence
Descriptiona sequence of actions
Actionperform actions of the sequence
Conditiontrue, if performed

KeyTypeDefaultDescription
actions[Actions]list of actions
loopbool1if false, the sequence is only executed once, otherwise repeatedly
singlebool0if true, only one action is selected for execution, otherwise all
randombool0if 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).

loopsinglerandomMeaning
truetruetrueeach time, one random action is executed
truetruefalseeach time, one action is executed according to the order; after the last follows the first again
truefalsetrueeach time, one action is executed in random order; the order of the list is random, but fixed until all items are executed once
truefalsefalseeach time, all actions are executed (default)
falsetruetrueonce, one random action is executed
falsetruefalseeach action is executed once in list order
falsefalsetrueeach action is executed once in random order
falsefalsefalseonce, all actions are executed

Case

Item typeCase
DescriptionA conditional branch.
Actionperforms the action for the first true condition
Conditiontrue, if performed

KeyTypeDefaultDescription
conditions[Conds]a list of conditions
actions[Actions]a list of according actions
negationvalue0negation 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.

Condition

Item typeCondition
Descriptionconditional branch
Actionone action depending on truth of condition
Conditiontrue, if performed

KeyTypeDefaultDescription
conditions[Conds][]a list of conditional items
trueActions<>action to execute, if condition is true
falseActions<>action to execute, if condition is false
orbool0if true, one condition must be true, otherwise all
loopbool0if true, the true condition is executed repeatedly until the condition is false (avoid endless loops!)
negationvalue0negation flags (see above: Case)

Note: If the conditions are empty, the condition executes the false and the true action alternate.

SetCondition

Item typeSetCondition
Descriptionchanges the state of a condition
Actionmarks a condition as true or false
Conditiontrue, if performed

KeyTypeDefaultDescription
conditionCondsan item that may be used as a condition
truebool0the 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.

SetVariable

Item typeSetVariable
Descriptionsets a variable
Actionassigns a value to an item variable
Conditiontrue, if performed

KeyTypeDefaultDescription
variablebytevariable name
itemitem<>new value of the variable