For the complete documentation index, see llms.txt. This page is also available as Markdown.

Loops

Loop actions allow you to execute the same group of actions multiple times.

[FOR]

actions:
- "[FOR] 5"
- "[MESSAGE] Hello!"
- "[ENDFOR]"

Executes all actions between [FOR] and [ENDFOR] the specified number of times.

In this example, the player receives 5 messages.

[ENDFOR]

actions:
- "[ENDFOR]"

Marks the end of the loop.

Every [FOR] must have a matching [ENDFOR].

Nested Loops

actions:
  - "[FOR] 2"

  - "[MESSAGE] Outer loop"

  - "[FOR] 3"
  - "[MESSAGE] Inner loop"
  - "[ENDFOR]"

  - "[ENDFOR]"

Loops can be nested.

Execution:

The outer loop runs 2 times, and during each iteration the inner loop runs 3 times, resulting in 6 executions of the inner message.

Dynamic count

The number of iterations can be any expression supported by the expression engine.

If the player executes:

The message will be sent 4 times.

Example

Last updated