Loops

[FOR]

Execute a loop for a specific number of executions. You can use the placeholder %i% to get the current run number.

Example:

for:
  permission-required: false
  cooldown: 0
  actions:
    - "[FOR] 5"
    - "[MESSAGE] Action %i%"
    - "[ROF]"
    - "[MESSAGE] Actions outside the loop"

[ROF]

(ROF is FOR in reverse) Marks the end of a loop, everything behind the ROF does not belong to the loop

Example:

for:
  permission-required: false
  cooldown: 0
  actions:
    - "[FOR] 10"
    - "[MESSAGE] Action %i%"
    - "[ROF]"
    - "[MESSAGE] Actions outside the loop"

[WHILE]

The loop is executed as long as the condition is met (you can use %i% placeholder)

Example:

while:
  permission-required: false
  cooldown: 0
  actions:
    - "[WHILE] %tchat_xp% < 10"
    - "[XP] ADD 5"
    - "[ELIHW]"
    - "[MESSAGE] Actions outside the loop"

[ELIHW]

(ELIHW is WHILE in reverse) Marks the end of the WHILE loop

Example:

while:
  permission-required: false
  cooldown: 0
  actions:
    - "[WHILE] %tchat_xp% < 10"
    - "[XP] ADD 5"
    - "[ELIHW]"
    - "[MESSAGE] Actions outside the loop"

[BREAK]

Breaks an active loop

Example:

break:
  permission-required: false
  cooldown: 0
  actions:
    - "[FOR] 5"
    - "[MESSAGE] Test %i%"
    - "[IF] %i% == 3"
    - "[BREAK]"
    - "[FI]"
    - "[ROF]"

Last updated