Difference between revisions of "Bot Playground/Events"
From SmartBots Developers Docs
| Line 32: | Line 32: | ||
{{API_Group|Online status}} | {{API_Group|Online status}} | ||
| + | {{API_Entry|HTTP Bot Command|before_login}} | ||
{{API_Entry|HTTP Bot Command|after_login}} | {{API_Entry|HTTP Bot Command|after_login}} | ||
{{API_Entry|HTTP Bot Command|before_logout}} | {{API_Entry|HTTP Bot Command|before_logout}} | ||
| + | {{API_Entry|HTTP Bot Command|login_error}} | ||
{{API_Table_end}} | {{API_Table_end}} | ||
Revision as of 15:07, 1 July 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);
});
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 | ||
| before_login | Fires when bot is going to login to Second Life. | |
| after_login | Fires when bot successfully logged to Second Life. | |
| before_logout | Fires when bot is going offline. | |
| login_error | Fires when bot is unable to login to Second Life. Not available for QubicBot yet (?) | |