Difference between revisions of "Bot Playground/Events"
From SmartBots Developers Docs
(6 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
{{API_Table_start|Command|Description}} | {{API_Table_start|Command|Description}} | ||
+ | |||
+ | <!-- | ||
+ | {{API_Group|Agent data}} | ||
+ | {{API_Entry|HTTP Bot Command|agent_data}} --> | ||
{{API_Group|Messaging}} | {{API_Group|Messaging}} | ||
{{API_Entry|HTTP Bot Command|chat_message}} | {{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|start_typing}} | ||
+ | {{API_Entry|HTTP Bot Command|stop_typing}} | ||
{{API_Entry|HTTP Bot Command|teleport_offer}} | {{API_Entry|HTTP Bot Command|teleport_offer}} | ||
Line 27: | Line 33: | ||
{{API_Entry|HTTP Bot Command|inventory_offer}} | {{API_Entry|HTTP Bot Command|inventory_offer}} | ||
{{API_Entry|HTTP Bot Command|balance_changed}} | {{API_Entry|HTTP Bot Command|balance_changed}} | ||
+ | |||
+ | {{API_Group|Friendship}} | ||
+ | {{API_Entry|HTTP Bot Command|friendship_offer}} | ||
{{API_Group|Movement}} | {{API_Group|Movement}} | ||
+ | {{API_Entry|HTTP Bot Command|autopilot_completed}} | ||
+ | {{API_Entry|HTTP Bot Command|autopilot_started}} | ||
+ | {{API_Entry|HTTP Bot Command|autopilot_stuck}} | ||
+ | {{API_Entry|HTTP Bot Command|self_position}} | ||
{{API_Entry|HTTP Bot Command|sit}} | {{API_Entry|HTTP Bot Command|sit}} | ||
+ | {{API_Entry|HTTP Bot Command|teleport_status}} | ||
{{API_Group|World}} | {{API_Group|World}} | ||
+ | {{API_Entry|HTTP Bot Command|region_restart}} | ||
+ | {{API_Entry|HTTP Bot Command|region_restart_cancelled}} | ||
{{API_Entry|HTTP Bot Command|script_dialog}} | {{API_Entry|HTTP Bot Command|script_dialog}} | ||
Line 38: | Line 54: | ||
{{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|after_logout}} | ||
{{API_Entry|HTTP Bot Command|login_error}} | {{API_Entry|HTTP Bot Command|login_error}} | ||
Latest revision as of 09:49, 7 December 2023
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. | |
start_typing | Fires when another avatar starts typing in IM to the bot. Not available for QubicBot yet (?) | |
stop_typing | Fires when another avatar stops typing in IM to the bot. Not available for QubicBot yet (?) | |
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 | |
Friendship | ||
friendship_offer | Fires when bot receives a friendship offer | |
Movement | ||
autopilot_completed | Fires when bot autopilot successfully completes its journey. Not available for QubicBot yet (?) | |
autopilot_started | Fires when bot autopilot starts. Not available for QubicBot yet (?) | |
autopilot_stuck | Fires when bot autopilot gets stuck and gives up moving further. Not available for QubicBot yet (?) | |
self_position | Fires when bot in-world location, position or heading changes. Not available for QubicBot yet (?) | |
sit | Fires when bot sits on the object | |
teleport_status | Fires when bot teleports, indicating various stages of the teleport. Not available for QubicBot yet (?) | |
World | ||
region_restart | Fires when bot receives a region restart notification. Not available for QubicBot yet (?) | |
region_restart_cancelled | Fires when bot receives a region restart cancellation notification. Not available for QubicBot yet (?) | |
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. | |
after_logout | Fires after bot goes offline. Not available for QubicBot yet (?) | |
login_error | Fires when bot is unable to login to Second Life. Not available for QubicBot yet (?) |