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."
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).

