Difference between revisions of "AdminBot for LSL/Events"

From SmartBots Developers Docs
Jump to: navigation, search
(Group status request events)
(Avatar status request events)
Line 65: Line 65:
 
| colspan="3" | SB_GROUP_CHECKED
 
| colspan="3" | SB_GROUP_CHECKED
 
|-
 
|-
| The reply to a [[SB_AVATAR_GROUP (AdminBot)|SB_AVATAR_GROUP]] command.
+
| The reply to a [[AdminBot_for_Groups/Commands/SB_AVATAR_GROUP|SB_AVATAR_GROUP]] command.
 
| class="row-a" | 0 - avatar is not in the group
 
| class="row-a" | 0 - avatar is not in the group
 
1 - avatar is in the group
 
1 - avatar is in the group
Line 72: Line 72:
 
|-
 
|-
 
| colspan="3" |
 
| colspan="3" |
 +
 
=== Group chat events ===
 
=== Group chat events ===
 
|- class="row-b"
 
|- class="row-b"

Revision as of 19:14, 29 June 2016

AdminBot raises events to inform your script about errors, chat IMs and other things happened. To catch it, use the LSL link_message event (see AdminBot Examples for usage patterns).

Parsing Events

LSL link_message event has the following syntax:

link_message( integer sender_num, integer num, string str, key id )

For AdminBot, num will contain the event code (see below). str and id value depend on the event.

Events List

The following events can be raised by AdminBot gateway:

Event / Description str id

Status events

SB_COMMAND_FAILED
Raised when command error occurs. first line - command status code
second line - text explaination
---
SB_SETUP_SUCCESS
Raised when group has been set successfully (group exists and not expired) group name group UUID
SB_SETUP_FAILED
Raised when there was an error setting the group (group does not exist, expired etc) first line - group status code
second life - group expiration date
---
SB_SETUP_BOTNAME
Raised after successful AdminBot initialization. Delivers the bot name and UUID serving the choosen group. SL bot name SL bot UUID

Group status request events

SB_STATUS_REPLY
Reply when you request the group status using SB_STATUS_QUERY first line - group status code
second line - group expiration date
group UUID

Avatar status request events

SB_GROUP_CHECKED
The reply to a SB_AVATAR_GROUP command. 0 - avatar is not in the group

1 - avatar is in the group

avatar UUID

Group chat events

SB_CHAT_SUCCESS
Raised when bot successfully connects to the group chat (see SB_CHAT_LISTEN) --- Group UUID
SB_CHAT_MESSAGE
Raised when bot receives the group chat message.

*Group chat saving must be enabled.

Resident name: Message Resident UUID

The numeric values are available here: Commands and events values.