{"id":3218,"date":"2022-10-12T03:37:46","date_gmt":"2022-10-12T08:37:46","guid":{"rendered":"https:\/\/www.mysmartbots.com\/blog\/?p=3218"},"modified":"2022-10-13T10:44:27","modified_gmt":"2022-10-13T15:44:27","slug":"bots-playground-new-scripting-commands-and-events","status":"publish","type":"post","link":"https:\/\/www.mysmartbots.com\/blog\/2022\/10\/bots-playground-new-scripting-commands-and-events\/","title":{"rendered":"Bots Playground new bot commands and events"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignright size-full wp-image-3219\" src=\"https:\/\/www.mysmartbots.com\/blog\/wp-content\/smartbots\/2022\/10\/20221012-playground-new-events.jpg\" alt=\"\" width=\"250\" height=\"250\" \/>SmartBots <a href=\"https:\/\/www.mysmartbots.com\/dev\/docs\/Bot_Playground\" target=\"_blank\" rel=\"noopener noreferrer\">Bots Playground<\/a> is a scripting sandbox\u00a0to control Second Life bots with\u00a0JavaScript.<\/p>\n<p>We continue a massive update of Bots Playground. New commands and events are now available!<\/p>\n<h2>New commands<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.mysmartbots.com\/dev\/docs\/Bot_Playground\/Commands\/regionRestart\" target=\"_blank\" rel=\"noopener noreferrer\">regionRestart<\/a> &#8211;\u00a0Queries to restart current region of the bot<\/li>\n<li><a href=\"https:\/\/www.mysmartbots.com\/dev\/docs\/Bot_Playground\/Commands\/regionRestartCancel\" target=\"_blank\" rel=\"noopener noreferrer\">regionRestartCancel<\/a> &#8211;\u00a0Cancels pending restart of current region<\/li>\n<li><a href=\"https:\/\/www.mysmartbots.com\/dev\/docs\/Bot_Playground\/Commands\/takeInworldPrim\" target=\"_blank\" rel=\"noopener noreferrer\">takeInworldPrim<\/a> &#8211;\u00a0Takes (de-rezzes) or copies in-world prim into bot&#8217;s inventory.<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>New events<\/h2>\n<ul>\n<li>region_restart &#8211;\u00a0bot receives a region restart notification<\/li>\n<li>region_restart_cancelled &#8211;\u00a0bot receives a region restart cancellation notification<\/li>\n<li>self_position &#8211;\u00a0bot in-world location, position or heading changes<\/li>\n<li>teleport_status &#8211;\u00a0bot teleports, indicating various stages of the teleport<\/li>\n<li>start_typing &#8211;\u00a0another avatar starts typing in IM to the bot<\/li>\n<li>stop_typing &#8211;\u00a0another avatar stops typing in IM to the bot<\/li>\n<li>login_error &#8211; bot is unable to login to Second Life<\/li>\n<\/ul>\n<p>View events\u00a0reference in <a href=\"https:\/\/www.mysmartbots.com\/dev\/docs\/Bot_Playground\/Events\" target=\"_blank\" rel=\"noopener noreferrer\">Playground docs<\/a>.<\/p>\n<h2>Other changes<\/h2>\n<ul>\n<li><strong>process.name<\/strong> variable now\u00a0contains current script name<\/li>\n<li>bare exit() function renamed to\u00a0<strong>process.exit()<\/strong> (old exit() still works)<\/li>\n<li>bare sleep() function renamed to\u00a0<strong>process.sleep()<\/strong> (old sleep() still works)<\/li>\n<\/ul>\n<h2>Compatibility<\/h2>\n<p>New features are just deployed and may not be supported by\u00a0QubicBot app. Use SmartBots-hosted bots for now.<\/p>\n<p>The support will be included into upcoming QubicBot update.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SmartBots Bots Playground is a scripting sandbox\u00a0to control Second Life bots with\u00a0JavaScript. We continue a massive update of Bots Playground. New commands and events are now available! New commands regionRestart &#8211;\u00a0Queries to restart current region of the bot regionRestartCancel &#8211;\u00a0Cancels pending restart of current region takeInworldPrim &#8211;\u00a0Takes (de-rezzes) or copies in-world prim into bot&#8217;s inventory.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[359,144,73],"tags":[310,558,156,366,261],"_links":{"self":[{"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/posts\/3218"}],"collection":[{"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/comments?post=3218"}],"version-history":[{"count":5,"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/posts\/3218\/revisions"}],"predecessor-version":[{"id":3224,"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/posts\/3218\/revisions\/3224"}],"wp:attachment":[{"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/media?parent=3218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/categories?post=3218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mysmartbots.com\/blog\/wp-json\/wp\/v2\/tags?post=3218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}