Conditions
Conditions allow you to control when parts of your script execute. They are used in scripts, sections, and individual actions to gate execution based on the current state of your layout.
A condition is built as a tree of rules combined with logical operators. This gives you full flexibility to express simple checks as well as complex multi-criteria logic.
Rules
A rule is a single check against the current state of your layout. Each rule evaluates to either true or false. The following rule types are available:
- Accessory — Check if an accessory (e.g., a turnout) is in a specific state.
- Feedback — Check if a feedback sensor is active or inactive, and optionally whether it is occupied by a specific vehicle.
- Vehicle — Check a vehicle's speed, direction, active function, or profile.
- Flag — Check if a flag is enabled or disabled.
- Variable — Check if a variable has a specific value.
- Camera — Check if a camera detection point has been triggered.
You can also negate any rule — for example, "accessory is not thrown".
Groups (AND / OR)
Rules are organized into groups. Each group has a logical operator that determines how its children are combined:
- AND — All rules in the group must be true for the group to be true.
- OR — At least one rule in the group must be true for the group to be true.
The top-level condition is always a group. You choose whether it operates as AND or OR by tapping the group header.
The editor displays groups as bordered boxes with their operator (AND/OR) shown at the top. Rules are shown as labeled rows inside their group. A live summary of the full condition is shown at the bottom of the editor and stays visible while editing rules and groups.
Nesting groups
Groups can contain other groups, allowing you to build complex logic. For example:
Turnout 1 = thrown AND (Sensor A = active OR Sensor B = active)This means: "Turnout 1 must be thrown and either Sensor A or Sensor B must be active."
Reusable Conditions
If you find yourself using the same condition in multiple places — for example, in several scripts or sections — you can define it once and reuse it everywhere. Conditions are managed from the Conditions screen in your profile, where you can:
- Create a new condition with the + button.
- Edit a condition by tapping it. Each condition has a name and a condition tree (built with the same rules and groups described above).
- Duplicate or delete conditions. When deleting a condition that is in use, you will be asked to confirm.
- Reorder conditions by dragging.
The editor also shows a dependencies section that lists all the places where the condition is currently used.
Linking a condition
When editing a condition in a script, section, or action, the condition editor shows a toggle between Inline and Linked mode (if at least one reusable condition exists). Switching to Linked mode lets you pick a condition from a dropdown. The condition is then evaluated using the linked condition's rules instead of inline rules.
TIP
Use reusable conditions when the same logic appears in multiple places. If you later need to adjust the condition, you only have to change it once.
Editing
- Tap a group header (AND/OR) to edit its operator or delete it.
- Tap a rule to edit or delete it.
- Tap the + button on a group to add a rule or sub-group.
- Drag and drop rules and groups to reorder them within or between groups.
- Copy and paste an entire condition via the ellipsis menu (⋯) in the toolbar. This lets you reuse a condition from one place (e.g., a section) in another (e.g., a different section or action).

