Difference between revisions of "AdminBot for LSL/Events"

From SmartBots Developers Docs
Jump to: navigation, search
Line 15: Line 15:
 
The following events can be raised by AdminBot gateway:
 
The following events can be raised by AdminBot gateway:
  
{| width=100%
+
{| class="niceTable"
! Event / Description
+
! Event
! width=200 | str
+
! Description & Parameters
! width=150 | id
+
 
|-
 
|-
 
| colspan="3" |
 
| colspan="3" |
 
=== Status events ===
 
=== Status events ===
|- class="row-b"
+
 
| colspan="3" | SB_COMMAND_FAILED
+
 
|-
 
|-
 +
| SB_COMMAND_FAILED
 
| Raised when command error occurs.
 
| Raised when command error occurs.
| class="row-a" | first line - [[AdminBot_for_Groups/Documentation/Status_Codes|command status code]]<br>second line - text explaination
+
 
| class="row-a" | ---
+
'''str''':<br>
|- class="row-b"
+
first line - [[AdminBot_for_Groups/Documentation/Status_Codes|command status code]]<br>second line - text explaination
| colspan="3" | SB_SETUP_SUCCESS
+
 
 
|-
 
|-
 +
| SB_SETUP_SUCCESS
 
| Raised when group has been set '''successfully''' (group exists and not expired)
 
| Raised when group has been set '''successfully''' (group exists and not expired)
| class="row-a" | group name
+
 
| class="row-a" | group UUID
+
'''str''': group name
|- class="row-b"
+
 
| colspan="3" | SB_SETUP_FAILED
+
'''id''': group UUID
 +
 
 
|-
 
|-
 +
| SB_SETUP_FAILED
 
| Raised when there was an error setting the group (group does not exist, expired etc)
 
| Raised when there was an error setting the group (group does not exist, expired etc)
| class="row-a" | first line - [[AdminBot_for_Groups/Documentation/Status_Codes|group status code]]<br>second life - group expiration date
+
 
| class="row-a" | ---
+
'''str''':<br>
|- class="row-b"
+
first line - [[AdminBot_for_Groups/Documentation/Status_Codes|group status code]]<br>second life - group expiration date
| colspan="3" | SB_SETUP_BOTNAME
+
 
 
|-
 
|-
 +
| SB_SETUP_BOTNAME
 
| Raised after successful AdminBot initialization. Delivers the bot name and UUID serving the choosen group.
 
| Raised after successful AdminBot initialization. Delivers the bot name and UUID serving the choosen group.
| class="row-a" | SL bot name
+
 
| class="row-a" | SL bot UUID
+
'''str''': SL bot name
 +
 
 +
'''id''': SL bot UUID
  
 
|-
 
|-
 
| colspan="3" |
 
| colspan="3" |
 
 
=== Group status request events ===
 
=== Group status request events ===
|- class="row-b"
+
 
| colspan="3" | SB_STATUS_REPLY
+
 
|-
 
|-
 +
| SB_STATUS_REPLY
 
| Reply when you request the group status using [[AdminBot_for_Groups/Commands|SB_STATUS_QUERY]]
 
| Reply when you request the group status using [[AdminBot_for_Groups/Commands|SB_STATUS_QUERY]]
| class="row-a" | first line - [[AdminBot_for_Groups/Documentation/Status_Codes|group status code]]<br>second line - group expiration date
+
 
| class="row-a" | group UUID
+
'''str''':<br>
 +
first line - [[AdminBot_for_Groups/Documentation/Status_Codes|group status code]]<br>second line - group expiration date
 +
 
 +
'''id''': group UUID
  
 
|-
 
|-
 
| colspan="3" |
 
| colspan="3" |
 
 
=== Avatar status request events ===
 
=== Avatar status request events ===
|- class="row-b"
+
 
| colspan="3" | SB_GROUP_CHECKED
+
 
|-
 
|-
| The reply to a [[AdminBot_for_Groups/Commands/SB_AVATAR_GROUP|SB_AVATAR_GROUP]] command.
+
| SB_GROUP_CHECKED
| class="row-a" | 0 - avatar is not in the group
+
| The reply of the [[AdminBot_for_Groups/Commands/SB_AVATAR_GROUP|SB_AVATAR_GROUP]] command.
 +
 
 +
'''str''': 0 - avatar is not in the group<br>
 
1 - avatar is in the group
 
1 - avatar is in the group
| class="row-a" | avatar UUID
+
 
 +
'''id''': avatar UUID
  
 
|-
 
|-
 
| colspan="3" |
 
| colspan="3" |
 
 
=== Group chat events ===
 
=== Group chat events ===
|- class="row-b"
+
 
| colspan="3" | SB_CHAT_SUCCESS
+
 
|-
 
|-
 +
| SB_CHAT_SUCCESS
 
| Raised when bot successfully connects to the group chat (see [[AdminBot_for_Groups/Commands/SB CHAT LISTEN|SB_CHAT_LISTEN]])
 
| Raised when bot successfully connects to the group chat (see [[AdminBot_for_Groups/Commands/SB CHAT LISTEN|SB_CHAT_LISTEN]])
| class="row-a" | ---
+
 
| class="row-a" | Group UUID
+
'''id''': Group UUID
|- class="row-b"
+
 
| colspan="3" | SB_CHAT_MESSAGE
+
 
|-
 
|-
 +
| SB_CHAT_MESSAGE
 
| Raised when bot receives the group chat message.
 
| Raised when bot receives the group chat message.
 
'''*Group chat saving must be enabled.'''
 
'''*Group chat saving must be enabled.'''
| class="row-a" | Resident name: Message
+
 
| class="row-a" | Resident UUID
+
'''str''': ''resident-name'': ''message''
 +
 
 +
''id'': Resident UUID
 
|}
 
|}
  

Revision as of 21:33, 3 May 2017

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 & Parameters

Status events

SB_COMMAND_FAILED Raised when command error occurs.

str:
first line - command status code
second line - text explaination

SB_SETUP_SUCCESS Raised when group has been set successfully (group exists and not expired)

str: group name

id: group UUID

SB_SETUP_FAILED Raised when there was an error setting the group (group does not exist, expired etc)

str:
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.

str: SL bot name

id: SL bot UUID

Group status request events

SB_STATUS_REPLY Reply when you request the group status using SB_STATUS_QUERY

str:
first line - group status code
second line - group expiration date

id: group UUID

Avatar status request events

SB_GROUP_CHECKED The reply of the SB_AVATAR_GROUP command.

str: 0 - avatar is not in the group
1 - avatar is in the group

id: avatar UUID

Group chat events

SB_CHAT_SUCCESS Raised when bot successfully connects to the group chat (see SB_CHAT_LISTEN)

id: Group UUID

SB_CHAT_MESSAGE Raised when bot receives the group chat message.

*Group chat saving must be enabled.

str: resident-name: message

id: Resident UUID

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