Difference between revisions of "Bot Playground/Commands/regionRestart"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Queries to restart current region of the bot</onlyinclude> <syntaxhighlight lang="javascript"> Bot.regionRestart(delay); </synta...")
 
 
(2 intermediate revisions by the same user not shown)
Line 10: Line 10:
  
 
{{API Variable Group|Input}}
 
{{API Variable Group|Input}}
{{API Variable|objectName|yes}} The name of the object to touch.
+
{{API Variable|delay|no}} optional delay before restart, seconds. Default 120, minimum 30, maximum 240.
{{API Variable|linkNumber|yes}} The link number of the prim (root prim = 1)
+
 
{{API Variable Group|Output}}
 
{{API Variable Group|Output}}
 
{{API Return promise}}
 
{{API Return promise}}
Line 17: Line 16:
 
{{API Variables Table End}}
 
{{API Variables Table End}}
  
== Return value ==
+
== Permissions ==
  
* If object is not found, bot returns ''result.success=false'' and error message in ''result.error'' (use ''.then(function(result)'' to catch this).
+
The bot has to be an Estate Manager of the current region.
* If linkNumber is wrong (less than 1 or more than number of child prims), function returns a success but no touch happens.
+
 
+
== Comments ==
+
 
+
Remember that bot have to load all objects from SL before touching them. So:
+
 
+
* after logging in, give bot about 30 seconds to load surrounding objects,
+
* the same after teleporting.
+
 
+
=== Determining the link number ===
+
 
+
The root prim is always 1 (so, linkNumber=1 for 1-prim objects too).
+
 
+
To get the link number of the specific child prim use Phoenix Firestorm viewer:
+
 
+
[[Image:Get object linknum.jpg|center|link=|border]]
+
 
+
# Start editing your object
+
# Check "Edit linked" option
+
# Select required child prim
+
# See the "Link number" value
+
  
 
== Examples ==
 
== Examples ==
  
Touch a special test attachment object (contact SmartBots support to get it):
+
See a [[Bot_Playground/Examples/Region_restart|complex region restart script]] in Examples.
 
+
<syntaxhighlight lang="javascript">
+
// Touch the button of the "Touch tester v2.0" object:
+
Bot.touchAttachment("Touch tester v2.0", 2);
+
  
// Gracefully exit since we're done
 
exit();
 
</syntaxhighlight>
 
  
 
{{NavMenu}}
 
{{NavMenu}}
 
__NOTOC__
 
__NOTOC__

Latest revision as of 18:07, 6 October 2022

Queries to restart current region of the bot

Bot.regionRestart(delay);

Reference

This command accepts the following parameters:

Variable Required Description


Input:
delay optional optional delay before restart, seconds. Default 120, minimum 30, maximum 240.
Output:
Function returns a Promise with the following data:
success bool true if command completed successfully
error string error string if command has failed

Permissions

The bot has to be an Estate Manager of the current region.

Examples

See a complex region restart script in Examples.