TChat
Tect.host
  • Introduction
  • General
    • Addons
    • Basic chat
    • Commands and permissions
    • Utils
    • Placeholders
  • Autobroadcast
    • Configuration
    • Command
  • BannedCommands
    • Configuration
    • Command
  • BannedWords
    • Configuration
    • Command
  • Channels
    • Configuration
    • Command
  • Chat Color
    • Configuration
    • Command
    • Menu
  • Chat Games
    • Configuration
      • Key words
    • Command
  • Custom Commands
    • Configuration
      • Conditionals
      • Loops
  • Ignore
    • Configuration
    • Command
  • Invsee
    • Configuration
  • Levels
    • Configuration
  • Me formatter
    • Configuration
    • Command
  • Polls
    • Configuration
    • Command
  • Print formatter
    • Configuration
    • Command
  • Show Ender Chest
    • Configuration
  • Tags
    • Configuration
    • Menu configuration
    • Command
  • Worlds
    • Configuration
Powered by GitBook
On this page
  • [FOR]
  • [ROF]
  • [WHILE]
  • [ELIHW]
  • [BREAK]
  1. Custom Commands
  2. Configuration

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 8 months ago