List of Resources

See MKB through human eyes
Filter by Type:
All Action Event Iterator Parameter REPL Command Variable
Filter by Category:
All Calculations Control Flow Equipped Armor Equipped Tool GUI Input Looking at Mod related Player Position Server Settings Time and Date Variables World

Filtros ativos: Categoria: "Control Flow"

ASSIGN
Action

Internal function

Category: Control Flow
BREAK
Action

Interrupts exection of the innermost loop. Can be used with: * `DO;LOOP` * `DO;UNTIL` * `DO;WHILE` * `FOR;NEXT` * `FOREACH;NEXT`

Category: Control Flow
DO
Action

Begins a loop. Needs to be closed with `LOOP,` `WHILE`, or `UNTIL`. The loop can be exited early by using `BREAK`. It is possible to specify a `[count]` number for it to have a maximum amount of loops. If this number is not specified, it will loop indefinitely.

Category: Control Flow
ELSE
Action

The actions following this action will only be executed if no if-clause before evaluated to `true`. Can be used with: * `IF` * `IFBEGINSWITH` * `IFCONTAINS` * `IFENDSWITH` * `IFMATCHES` * `ELSEIF`

Category: Control Flow
ELSEIF
Action

The actions following this action will only be executed when the `<condition>` evaluates to `true` and no if-clause before evaluated to true. Can be used with: * `IF` * `IFBEGINSWITH` * `IFCONTAINS` * `IFENDSWITH` * `IFMATCHES`

Category: Control Flow
ENDIF
Action

Ends an if-clause.

Category: Control Flow
ENDUNSAFE
Action

Ends an active UNSAFE block

Category: Control Flow
FOR
Action

Begins a for loop using the specified `<#var>` as a loop counter. Needs to be closed with `NEXT`. The loop can be exited early by using `BREAK`. Alternative syntax: ``` FOR(<#var> = <start> to <end>) FOR(<#var> = <start> to <end> step <step>) ```

Category: Control Flow
FOREACH
Action

Runs a loop over the specified iterator. Needs to be closed with `NEXT`. The iterator can either be [one of the these](/docs/iterators/) or an array. The loop can be exited early by using `BREAK`. Alternative Syntax: ``` FOREACH(<&array[]>,<&content>,[#index]) FOREACH(<&array[]> as <&content>) FOREACH(<&array[]> as <#index> => <&content>) ```

Category: Control Flow
IF
Action

The actions following this action will only be executed when the `<condition>` evaluates to `true`. Needs to be closed with an `ENDIF`.

Category: Control Flow
IFBEGINSWITH
Action

The actions following this action will only be executed when the `<haystack>` starts with `<needle>`.

Category: Control Flow
IFCONTAINS
Action

The actions following this action will only be executed when the `<haystack>` contains the `<needle>`.

Category: Control Flow
IFENDSWITH
Action

The actions following this action will only be executed when the `<haystack>` ends with `<needle>`.

Category: Control Flow
IFMATCHES
Action

The actions following this action will only be executed when the `<subject>` matches the `<pattern>`. Optionally the whole match (or only a group specified by `[group]`) can be saved into `[&target]`.

Category: Control Flow
IIF
Action

Inline IF statement. Sends `<truetext>` as a chat message if condition succeeds, or sends `<falsetext>` if not.

Category: Control Flow
LOOP
Action

Ends a loop that was started with DO

Category: Control Flow
NEXT
Action

Completes a for or foreach loop

Category: Control Flow
STOP
Action

Stops the current macro, or macros matching the specified ID For stopping all macros you can use either `"all"` or `"*"`. The ID of a script is displayed in the "Macro Activate" screen, and will be always the task name, when it was started through [EXEC](/docs/actions/exec), or the name of the key/button, if it was started with file includes ($$<file.txt>) or ran directly from a key/button.

Category: Control Flow
UNSAFE
Action

Begins an `UNSAFE` block with maximum executions set to `<executions>`. `<executions>` has to be between `0` and `10000`. Default is `100`.

Category: Control Flow
UNTIL
Action

Completes a loop started with DO but exits the loop if `<condition>` is met.

Category: Control Flow
WAIT
Action

Pauses the script for the time (in seconds) specified, suffix `ms` for a wait in milliseconds or `t` to wait in ticks. It is not possible to wait less than the duration of a tick (`~50ms`), because the mod checks each tick if it should continue.

Category: Control Flow
WHILE
Action

Completes a loop started with DO but exits the loop if `<condition>` is not met

Category: Control Flow