Get 1Click Maker

Conditions ​

A condition compares two values. If the comparison is true, one function runs; if not, another one does.

text
If   $state  ==  ON
     β”œβ”€ true  β†’ run "turn_off"
     └─ false β†’ run "turn_on"

Operators ​

OperatorTrue when
== equal toA is the same as B
!= not equal toA is different from B
> greater thanA is larger than B
< less thanA is smaller than B
>= greater or equalA is larger than or the same as B
<= less or equalA is smaller than or the same as B

What can be compared ​

Each side can be a fixed value, a user variable ($name) or a system variable (!name). Both sides must be of compatible types:

AllowedNot allowed
number with number (integer and float mix freely)text with number ("A" > 2)
string with stringvector with number
key with key, or key with string
vector with vector

For strings and keys, == and != are the meaningful operators. Comparisons are case-sensitive: ON and on are different.

Success and failure ​

Every condition has two outcomes, each a small branch function: success runs when true, failure when false. Either can be left empty. Branches are created from the buttons on the condition's card and do not appear in the main function list; see Creating a Condition. Their memory is counted as part of the function that holds the condition.

After the chosen branch runs, the original function continues with its next action.

Nesting ​

A branch function can itself contain a condition. That is how you build "if owner, then if face 2, then…". Two or three levels are readable; beyond that, rethink the design.

Cost ​

Conditions are the most expensive action to run: each one is a small detour through the add-on script. Guidelines:

  • A few conditions per click: fine.
  • A condition inside a fast Timer loop: keep the delay at 0.1 s or more.
  • Dozens of chained conditions: noticeable delay. Split the logic or use fewer states.

Memory cost is modest: 40 units per condition, plus 30 for each branch that has actions, plus the actions themselves.

Debugging tip ​

Add a Message as the first action in each branch ("branch: on", "branch: off") while you test. Delete them before Finish.