# Options, Variables, & Aliases

The `options:`, `variables:`, and `aliases:` sections are structures in a script that can be used as sort of short-cuts within that file.

### Options

The `options:` section allows for something to be distributed throughout a script. Options are prefixed with an `@` when used.

{% code overflow="wrap" lineNumbers="true" %}

```python
options:
  message: "You cannot do this while you are in combat!"

on teleport:
  player is combat logged
  cancel event
  send {@message} to player

on command:
  player is combat logged
  cancel event
  send {@message} to player
```

{% endcode %}

{% hint style="warning" %}
Note that options will be literally replaced with code from Skript's perspective, so while they might make a line look shorter, they do not decrease parsing stress. For example, Skript will literally interpret lines 7 and 12 as `send "You cannot do this while you are in combat! to player`.

Be careful not to put complicated expressions in options!
{% endhint %}

### Variables

The `variables:` section provides a default value for variables to fall back on if they are not set:

{% code overflow="wrap" lineNumbers="true" %}

```python
variables:
  {food} = (64 of potato)

#: Running this command should give a stack of potatoes
command food:
  trigger:
    give executor {food}

#: After setting `{food}` to steak, `/food` should give a stack of steak
command setFood:
  trigger:
    set {food} to (64 of steak)

#: Deleting the variable `{food}` should make
#: the command go back to giving potatoes
command resetFood:
  trigger:
    delete {food}
```

{% endcode %}

### Aliases

The `aliases:` section allows for defining custom names for a set:

{% code overflow="wrap" lineNumbers="true" %}

```python
aliases:
  magic wands = stick, (blaze rod), (breeze rod)
  rewards = diamond, emerald, (lapis lazuli), (redstone dust)

on right-click:
  if (magic wands) contains (type of player's tool):
    send "Woosh! You waved your magic wand and got a reward!" to player
    give player (random element of rewards)
```

{% endcode %}


---

# Agent Instructions: 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:

```
GET https://x8ight.gitbook.io/syntask/fundamentals/structures/options-variables-and-aliases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
