# Usage

Want to tell someone how to use a command? When a player inputs incorrect arguments, use the `usage:` property to tell them how to do it correctly.

If no message is supplied will default to `"%command name% <%argument types%>"`.

Example:

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

```python
#: Poorly-written command
command coinflip <amount:number>:
  trigger:
    if {_amount} is set:
      chance of 50%:
        add {_amount} to executor's balance
        send "It's heads!" to executor

      else:
        remove {_amount} from executor's balance
        send "It's tails!" to executor
    else:
      send "You need to specify how much you are betting!" to executor
```

{% endcode %}

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

```python
#: Well-written command
command coinflip <amount:number>:
  usage: Correct usage: /coinflip <bet>
  trigger:
    chance of 50%:
      add {_amount} to executor's balance
      send "It's heads!" to executor

    else:
      remove {_amount} from executor's balance
      send "It's tails!" to executor
```

{% endcode %}

{% hint style="warning" %}
The usage message will be sent if there is any issue at all with any of their arguments, which may not be too helpful, as it doesn't specify *which* argument causes the issue.

This will also only check the datatype of an argument, and not its actual value. So in this example, it would not be able to stop the player from placing a negative bet on a coin flip. To make sure they can only bet positive amounts—and a maximum of their balance—a condition can be used within the command's trigger.
{% endhint %}


---

# 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/commands/usage.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.
