Difference between revisions of "Bot Playground/Events"
From SmartBots Developers Docs
| Line 15: | Line 15: | ||
{{API_Group|Messaging}} | {{API_Group|Messaging}} | ||
| + | {{API_Entry|HTTP Bot Command|chat_message}} | ||
{{API_Entry|HTTP Bot Command|instant_message}} | {{API_Entry|HTTP Bot Command|instant_message}} | ||
| + | {{API_Entry|HTTP Bot Command|teleport_offer}} | ||
| + | |||
| + | {{API_Group|Group Messaging}} | ||
| + | {{API_Entry|HTTP Bot Command|group_offer}} | ||
| + | {{API_Entry|HTTP Bot Command|group_im}} | ||
| + | {{API_Entry|HTTP Bot Command|group_notice}} | ||
| + | |||
| + | {{API_Group|Inventory}} | ||
| + | {{API_Entry|HTTP Bot Command|inventory_offer}} | ||
| + | {{API_Entry|HTTP Bot Command|balance_changed}} | ||
| + | |||
| + | {{API_Group|World}} | ||
| + | {{API_Entry|HTTP Bot Command|script_dialog}} | ||
| + | |||
| + | {{API_Group|Online status}} | ||
| + | {{API_Entry|HTTP Bot Command|after_login}} | ||
| + | {{API_Entry|HTTP Bot Command|before_logout}} | ||
{{API_Table_end}} | {{API_Table_end}} | ||
Revision as of 16:48, 28 June 2016
Event is a callback function which is invoked when something happens with your bot or surrounding world.
Callbacks are set using a special on() function:
Bot.on("instant_message", function(data) {
console.log("bot got a message:", data);
});
Contents
Events reference
| Command | Description | |
|---|---|---|
Messaging | ||
| chat_message | Fires when bot receives a message in the local chat | |
| instant_message | Fires when bot receives a message from another avatar or in-world object. | |
| teleport_offer | Fires when bot receives a teleport offer from another avatar. | |
Group Messaging | ||
| group_offer | Fires when bot receives a group invite | |
| group_im | Fires when bot receives a group chat message. | |
| group_notice | Fires when bot receives a group notice. | |
Inventory | ||
| inventory_offer | Fires when bot receives a inventory offer | |
| balance_changed | Fires when bot receives or payd money | |
World | ||
| script_dialog | Fires when bot receives a scripted dialog with a menu buttons | |
Online status | ||
| after_login | Fires when bot successfully logged to Second Life. | |
| before_logout | Fires when bot is going offline. | |