Conditional Blocks
Conditionals let your automation make decisions. Connect a boolean-producing block to theCONDITION input and the Studio engine evaluates it at run time.
erlc_if_then
Runs the
DO statement block only when CONDITION is truthy. No else branch — execution continues with the next block either way.erlc_if_else
Evaluates
CONDITION and runs THEN if true, or ELSE if false. Both branches reconnect to the block after the if/else.erlc_compare_values
Compares
LEFT and RIGHT using the OPERATOR field (=, !=, >, >=, <, <=, contains). Returns a boolean.logic_compare
Blockly native compare block. Compares inputs
A and B using OP field values: EQ, NEQ, LT, LTE, GT, GTE. Returns a boolean.logic_operation
Combines two booleans (
A and B) with AND or OR logic via the OP field.logic_negate
Inverts the boolean value provided in the
BOOL input (logical NOT).logic_boolean
A literal boolean value block. Set the
BOOL field to TRUE or FALSE.erlc_event_field
Reads a field from the current event and tests it. Set
FIELD to the event property name and OPERATOR to equals, contains, or not_equals. Plug in a comparison value via the VALUE input. Returns a boolean.JSON Example — erlc_if_else with erlc_compare_values
The example below checks whether a player’s team name equals "Police". If true, it runs the THEN branch; otherwise it runs the ELSE branch.
erlc_compare_values is purpose-built for ERLC data and supports contains for partial string matching. Use logic_compare when you need the standard Blockly comparison operators (EQ, NEQ, etc.) on generic values.Loop Blocks
Loop blocks repeat a set of statement blocks. Connect your repeating logic to theDO input of any loop block.
erlc_repeat
Repeats the
DO body a fixed number of times. Connect a number block to the TIMES input.erlc_while
Repeats the
DO body while the CONDITION input remains truthy. Condition is checked before each iteration.erlc_repeat_until
Repeats the
DO body until the CONDITION input becomes truthy. Condition is checked after each iteration.erlc_repeat_for_seconds
Repeats the
DO body continuously for the duration provided in the SECONDS input.erlc_forever
Loops the
DO body indefinitely. This block has no next connection — nothing placed below it will ever execute.erlc_for_each
Iterates over every item in the
LIST input. Each item is stored in the variable named by the VARIABLE field and the DO body runs once per item.erlc_break_loop
Immediately exits the innermost running loop. This block has no
next connection.erlc_continue_loop
Skips the rest of the current iteration and jumps to the next. This block has no
next connection.Flow Control Blocks
Flow control blocks manage timing, error handling, and execution lifetime. Use them to pace your automations and guard against unexpected failures.erlc_wait
erlc_wait
Pauses execution for the number of seconds provided in the
SECONDS input. All subsequent blocks in the stack wait until the timer expires.erlc_wait_until
erlc_wait_until
Polls the
CONDITION input repeatedly and resumes execution only when it becomes truthy. Use this instead of a busy erlc_while loop when you need to wait for an external state change.erlc_stop_run
erlc_stop_run
Stops the entire automation run immediately. No
next connection — nothing below it executes.erlc_stop_stack
erlc_stop_stack
Stops only the current block stack, leaving other parallel stacks running.
erlc_stop_message_stack
erlc_stop_message_stack
Stops the current message-handling stack specifically. Useful inside Discord message event handlers.
erlc_throttle
erlc_throttle
Rate-limits a block section. The
DO body runs at most once per SECONDS window for a given KEY field value. Subsequent calls within the window are silently skipped.erlc_run_once
erlc_run_once
Runs the
DO body only once for the lifetime of the automation, identified by the KEY field. Subsequent executions reaching this block skip the body entirely.erlc_try_catch
erlc_try_catch
Wraps the
TRY statement body in an error boundary. If any block inside TRY throws an error, execution resumes from the CATCH statement body instead of stopping the run.Math Blocks
Math blocks produce numeric values or perform arithmetic. Connect them to any input that expects a number.Arithmetic
Random & Rounding
Min, Max, and Clamping
Advanced Math
math_arithmetic is the standard Blockly block for arithmetic. Connect number value blocks (such as math_number or erlc_number_value) to its A and B inputs, and choose the operation with the OP field: ADD, MINUS, MULTIPLY, DIVIDE, or POWER.