Set variable
Changes the value of a variable. You define the variables in your profile. While automation runs, each one holds a whole number between 0 and 255 that all scripts share, so one script can count or remember something that another script reacts to.
Settings
| Setting | Description |
|---|---|
| Variable | The variable to change. |
| Operation | What to do with it, see below. |
| Value | Only for Set to value: the new value (0–255). |
| Operation | Description |
|---|---|
| Set to value | Sets the variable to the given value. |
| Increase by 1 | Adds 1 to the current value. The value never goes above 255. |
| Decrease by 1 | Subtracts 1 from the current value. The value never goes below 0. |
How it works
- The new value is visible to all scripts immediately.
- Changing a variable can start other scripts that have a variable execution event configured.
- The execution log shows the new value of the variable.
Example
A staging yard has four tracks. Each script that parks a train in the yard uses Increase by 1 on the variable Yard trains, and each script that takes a train out uses Decrease by 1. A script that wants to send another train to the yard first checks that Yard trains is not equal to 4.

