> For the complete documentation index, see [llms.txt](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/deluxe-battle-kit-for-v21.1/mid-battle-scripting/command-keys/commands-utilities.md).

# Commands: Utilities

These are keys which trigger general utilities, such as creating a pause between actions, delaying an action until a certain point, or setting specific switches or variables.

<details>

<summary><mark style="background-color:blue;"><strong>"setBattler"</strong></mark> => <mark style="background-color:yellow;">Integer or Symbol</mark></summary>

Changes the battler to be used as the focus of many of the commands listed below and in other sections. By default, the battler that these commands apply to is determined by whichever battler triggered the initial Trigger Key. For example, if the Trigger Key is <mark style="background-color:purple;">"UserDealtDamage"</mark>, then the default battler is whoever is the user of the move that just dealt damage. With this key, however, you can manually set which battler should be the focus, regardless of what the default battler may be.&#x20;

To do this, you may simply set this to a battler index to have that battler be flagged as the new focus. Alternatively, you may also use one of the following symbols if you want to more generally assign which battler should be the new focus: `:Self`, `:Ally`, `:Ally2`, `:Opposing`, `:OpposingAlly`, `:OpposingAlly2`.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"wait"</strong></mark> => <mark style="background-color:yellow;">Integer or Float</mark></summary>

Freezes the battle scene and prevents anything from happening for a set number of seconds. You can enter a float number such as 0.5 for a half second pause.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"pause"</strong></mark> => <mark style="background-color:yellow;">Integer or Float</mark></summary>

Creates a delay that pauses any further actions from occurring for a set number of seconds. You can enter a float number such as 0.5 for a half second pause.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"ignoreUntil"</strong></mark> => <mark style="background-color:yellow;">String or Array</mark></summary>

Prevents any other keys below this one from activating until a specified Trigger Key has been triggered. For example, if you set this to <mark style="background-color:purple;">"BattlerFainted\_foe"</mark>, then no other keys in this hash will be able to trigger until one of the foe's Pokemon have fainted to trigger that key. Alternatively, you can set this to an array containing multiple Trigger Keys, and no other keys in this hash will be able to trigger until at least one of the Trigger Keys in this array have been triggered.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"ignoreAfter"</strong></mark> => <mark style="background-color:yellow;">String or Array</mark></summary>

Prevents any other keys below this one from activating after a specified Trigger Key has been triggered. For example, if you set this to <mark style="background-color:purple;">"BattlerFainted\_foe"</mark>, then no other keys in this hash will be able to trigger after one of the foe's Pokemon have fainted to trigger that key. Alternatively, you can set this to an array containing multiple Trigger Keys, and no other keys in this hash will be able to trigger once any of the Trigger Keys in this array have been triggered.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"toggleSwitch"</strong></mark> => <mark style="background-color:yellow;">Integer</mark></summary>

Toggles a particular game switch off or on. The integer set here determines which game switch to toggle. For example, if this is set to 75, then game switch 75 will be toggled on. If game switch 75 is already on, then it will be turned off instead.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"setVariable"</strong></mark> => <mark style="background-color:yellow;">Integer or Array</mark></summary>

Sets the default value of the midbattle variable to whatever number the set integer is. If set as an array of integers, a random value will be selected instead.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"addVariable"</strong></mark> => <mark style="background-color:yellow;">Integer or Array</mark></summary>

Adds to the value of the midbattle variable that is checked for by certain Trigger Keys. Whatever integer is set here will be added to the cumulative total of this variable. If you want to subtract an amount from this variable, set this to a negative number instead.

If set as an array of integers, a random value from this array will be selected to add to the variable's value.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"multVariable"</strong></mark> => <mark style="background-color:yellow;">Integer or Float</mark></summary>

Multiplies the value of the midbattle variable that is checked by certain Trigger Keys by whatever integer is set. If you want to divide the value of the this variable instead, then set this to a float number like 0.5 to divide the value of the variable by half (rounded).

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/deluxe-battle-kit-for-v21.1/mid-battle-scripting/command-keys/commands-utilities.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
