Events

AdminBot raises events to inform your script about errors, group chat messages, and other occurrences.
To handle these events, use the LSL link_message event.

Parsing Events

The link_message event has the following syntax:

link_message(integer sender_num, integer num, string str, key id) {
  if(num == SB_SETUP_SUCCESS) {
    // handle successful setup
  }
}
  • num — contains the event code

  • str and id — values depend on the specific event

Refer to the table below for details.

Events List

Command

Description

Command execution status

SB_COMMAND_FAILED

Raised when a command execution error occurs.

SB_COMMAND_COMPLETED

Raised when a command completes without errors.

Setup status

SB_SETUP_SUCCESS

Raised when the group is successfully set (exists and not expired).

SB_SETUP_FAILED

Raised when there is an error setting the group (not found, expired, etc).

SB_SETUP_BOTNAME

Raised after AdminBot initializes. Delivers bot name and UUID.

Group status request

SB_STATUS_REPLY

Reply from SB_STATUS_QUERY command.

Avatar status request

SB_GROUP_CHECKED

Reply from SB_AVATAR_GROUP command.

Group chat events

SB_CHAT_SUCCESS

Raised when bot successfully connects to group chat (SB_CHAT_LISTEN).

SB_CHAT_MESSAGE

Raised when a group chat message is received.


The numeric values for each event are available here.