BETA — Preview build
Skip to content
Store a number to use later in conditions

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 ​

SettingDescription
VariableThe variable to change.
OperationWhat to do with it, see below.
ValueOnly for Set to value: the new value (0–255).
OperationDescription
Set to valueSets the variable to the given value.
Increase by 1Adds 1 to the current value. The value never goes above 255.
Decrease by 1Subtracts 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.