Difference between revisions of "TotalControl for LSL/Events"

From SmartBots Developers Docs
Jump to: navigation, search
(Bot status request events)
Line 15: Line 15:
 
The following events can be raised by AdminBot for Bots gateway:
 
The following events can be raised by AdminBot for Bots gateway:
  
{| width=100%
+
{{API_Table_start|Command|Description}}
! Event / Description
+
! width=200 | str
+
! width=150 | id
+
|-
+
| colspan="3" |
+
=== Status events ===
+
|- class="row-b"
+
| colspan="3" | BOT_COMMAND_FAILED
+
|-
+
| Raised when command error occurs.
+
| class="row-a" | first line - [[AdminBot_for_Bots/Documentation/Status_Codes|command status code]]<br>second line - text explaination
+
| class="row-a" | ---
+
|- class="row-b"
+
| colspan="3" | BOT_SETUP_SUCCESS
+
|-
+
| Raised when bot has been set '''successfully''' (bot exists and not expired)
+
| class="row-a" | Bot name
+
| class="row-a" | ---
+
|- class="row-b"
+
| colspan="3" | BOT_SETUP_FAILED
+
|-
+
| Raised when there was an error setting the bot (bot does not exist, expired etc)
+
| class="row-a" | first line - [[AdminBot_for_Bots/Documentation/Status_Codes|bots status code]]<br>second life - bot expiration date
+
| class="row-a" | ---
+
|- class="row-b"
+
  
| colspan="3" |
+
{{API_Group|Status}}
 +
{{API_Entry|HTTP Bot Command|BOT_SETUP_SUCCESS}}
 +
{{API_Entry|HTTP Bot Command|BOT_SETUP_FAILED}}
 +
{{API_Entry|HTTP Bot Command|BOT_COMMAND_FAILED}}
 +
{{API_Entry|HTTP Bot Command|BOT_EVENT_STATUS_REPLY}}
  
=== Bot status request events ===
+
{{API_Group|Group Messaging}}
|- class="row-b"
+
{{API_Entry|HTTP Bot Command|BOT_EVENT_LISTEN_SUCCESS}}
| colspan="3" | BOT_EVENT_STATUS_REPLY
+
{{API_Entry|HTTP Bot Command|BOT_EVENT_LISTEN_LOCAL_CHAT}}
|-
+
{{API_Entry|HTTP Bot Command|BOT_EVENT_LISTEN_IM}}
| Reply when you request the bot status using [[AdminBot_for_Bots/Commands|BOT_STATUS_QUERY]]
+
{{API_Entry|HTTP Bot Command|BOT_EVENT_LISTEN_INVENTORY}}
| class="row-a" | first line - [[AdminBot_for_Bots/Documentation/Status_Codes|bots status code]]<br>second line - bot expiration date
+
{{API_Entry|HTTP Bot Command|BOT_EVENT_LISTEN_MONEY}}
| class="row-a" | ---
+
{{API_Entry|HTTP Bot Command|BOT_EVENT_LISTEN_DIALOG}}
  
|-
+
{{API_Table_end}}
| colspan="3" |
+
 
+
=== 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.
+
| class="row-a" | 0 - avatar is not in the group
+
1 - avatar is in the group
+
| class="row-a" | avatar UUID
+
 
+
|-
+
| colspan="3" |
+
 
+
=== Group chat events ===
+
|- class="row-b"
+
| colspan="3" | BOT_EVENT_LISTEN_SUCCESS
+
|-
+
| 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
+
|- class="row-b"
+
| colspan="3" | SB_CHAT_MESSAGE
+
|-
+
| Raised when bot receives the group chat message.
+
'''*Group chat saving must be enabled.'''
+
| class="row-a" | Resident name: Message
+
| class="row-a" | Resident UUID
+
|}
+
 
+
The numeric values are available here: [[AdminBot Examples: Header variables|Commands and events values]].
+
  
 
{{NavMenu}}
 
{{NavMenu}}
  
 
__NOTOC__
 
__NOTOC__

Revision as of 16:36, 6 July 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 for Bots gateway:

Command Description

Status

BOT_SETUP_SUCCESS Raised when Bot has been set successfully
BOT_SETUP_FAILED Raised when there was an error setting the bot
BOT_COMMAND_FAILED Raised when command error occurs.
BOT_EVENT_STATUS_REPLY Raised when bot status is received.

Group Messaging

BOT_EVENT_LISTEN_SUCCESS Raised when a listener has successfully been established
BOT_EVENT_LISTEN_LOCAL_CHAT Raised when Bot sees a message in local chat
BOT_EVENT_LISTEN_IM Raised when Bot receives an instant message
BOT_EVENT_LISTEN_INVENTORY Raised when Bot receives an inventory item
BOT_EVENT_LISTEN_MONEY Raised when Bot receives a payment
BOT_EVENT_LISTEN_DIALOG Raised when Bot receives a dialog menu