# Events

The **TotalControl** library raises events to inform your script about errors, chat messages, IMs, and other activities.

  
To catch these events, use the LSL `link_message` event (see [TotalControl Examples](/doc/examples-hXsET8az4A) for usage patterns).

## Parsing Events

The `link_message` event in LSL has the following syntax:

```csharp
link_message(integer sender_num, integer num, string str, key id) { ... }
```

For **TotalControl**, the `num` parameter contains the event code (see below).  
The values of `str` and `id` depend on the event type.

## Events List

| **Command** | **Description** |
|---------|-------------|
| **Status** |             |
| [`BOT_SETUP_SUCCESS`](/doc/bot_setup_success-QLVy1LhVJN) | Raised when Bot has been set successfully. |
| [`BOT_SETUP_FAILED`](/doc/bot_setup_failed-yy58DIzSt3) | Raised when there was an error setting the bot. |
| [`BOT_COMMAND_FAILED`](/doc/bot_command_failed-JVxDdlfZF6) | Raised when a command error occurs. |
| [`BOT_EVENT_STATUS_REPLY`](/doc/bot_event_status_reply-Cr9dCkD6qo) | Raised when bot status is received. |
| **Listeners** |             |
| [`BOT_EVENT_LISTEN_SUCCESS`](/doc/bot_event_listen_success-Brr4lFi7ZP) | Raised when a listener has successfully been established. |
| [`BOT_EVENT_LISTEN_LOCAL_CHAT`](/doc/bot_event_listen_local_chat-lOHOH6AxmP) | Raised when Bot sees a message in local chat. |
| [`BOT_EVENT_LISTEN_IM`](/doc/bot_event_listen_im-K07iKPMfqm) | Raised when Bot receives an instant message. |
| [`BOT_EVENT_LISTEN_INVENTORY`](/doc/bot_event_listen_inventory-LMwbM3okka) | Raised when Bot receives an inventory item. |
| [`BOT_EVENT_LISTEN_MONEY`](/doc/bot_event_listen_money-kuvS0yd72f) | Raised when Bot receives a payment. |
| [`BOT_EVENT_LISTEN_DIALOG`](/doc/bot_event_listen_dialog-Mpa8Xx2eMS) | Raised when Bot receives a dialog menu. |
| **Request Responses** |             |
| [`BOT_LIST_GROUPS_REPLY`](/doc/bot_list_groups_reply-d4VfOM4EEQ) | Raised when Bot receives list of groups. |
| [`BOT_LIST_GROUP_ROLES_REPLY`](/doc/bot_list_group_roles_reply-qqxUbtO1KE) | Raised when Bot receives list of roles for a group. |
| [`BOT_GET_BALANCE_REPLY`](/doc/bot_get_balance_reply-2co4RdrnEw) | Raised when balance is successfully requested. |
| [`BOT_ATTACHMENTS_REPLY`](/doc/bot_attachments_reply-P26H0YJbkL) | Raised when Bot receives list of attachments. |
| [`BOT_LOCATION_REPLY`](/doc/bot_location_reply-4SCssgKKs1) | Raised when bot returns its location. |
| [`BOT_NOTECARD_CREATE_REPLY`](/doc/bot_notecard_create_reply-h96sqsuv0C) | Raised when balance is successfully requested. |
| [`BOT_NOTECARD_READ_REPLY`](/doc/bot_notecard_read_reply-I0wJUDw9Ka) | Raised when balance is successfully requested. |

---

**Documents**

- [BOT_ATTACHMENTS_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_attachments_reply-P26H0YJbkL)
- [BOT_COMMAND_FAILED](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_command_failed-JVxDdlfZF6)
- [BOT_EVENT_LISTEN_DIALOG](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_event_listen_dialog-Mpa8Xx2eMS)
- [BOT_EVENT_LISTEN_IM](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_event_listen_im-K07iKPMfqm)
- [BOT_EVENT_LISTEN_INVENTORY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_event_listen_inventory-LMwbM3okka)
- [BOT_EVENT_LISTEN_LOCAL_CHAT](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_event_listen_local_chat-lOHOH6AxmP)
- [BOT_EVENT_LISTEN_MONEY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_event_listen_money-kuvS0yd72f)
- [BOT_EVENT_LISTEN_SUCCESS](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_event_listen_success-Brr4lFi7ZP)
- [BOT_EVENT_STATUS_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_event_status_reply-Cr9dCkD6qo)
- [BOT_GET_BALANCE_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_get_balance_reply-2co4RdrnEw)
- [BOT_LIST_GROUP_ROLES_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_list_group_roles_reply-qqxUbtO1KE)
- [BOT_LIST_GROUPS_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_list_groups_reply-d4VfOM4EEQ)
- [BOT_LOCATION_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_location_reply-4SCssgKKs1)
- [BOT_NOTECARD_CREATE_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_notecard_create_reply-h96sqsuv0C)
- [BOT_NOTECARD_READ_REPLY](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_notecard_read_reply-I0wJUDw9Ka)
- [BOT_SETUP_FAILED](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_setup_failed-yy58DIzSt3)
- [BOT_SETUP_SUCCESS](https://sb-docs-dev.getoutline.com/s/dev/doc/bot_setup_success-QLVy1LhVJN)