Difference between revisions of "TotalControl for LSL/Commands/BOT SETUP SETBOT"

From SmartBots Developers Docs
Jump to: navigation, search
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
 
<onlyinclude>Sets the working personal Bot. Other commands require this command to be invoked first.</onlyinclude>
 
<onlyinclude>Sets the working personal Bot. Other commands require this command to be invoked first.</onlyinclude>
 +
 +
<syntaxhighlight lang="lsl">
 +
llMessageLinked(LINK_SET,BOT_SETUP_SETBOT,"My bot name","ACCESS CODE");
 +
</syntaxhighlight>
  
 
{{API Variables Table}}
 
{{API Variables Table}}
Line 13: Line 17:
  
 
One of the following events will be generated:
 
One of the following events will be generated:
* [[AdminBot for Bots/Events|BOT_SETUP_SUCCESS]]
+
* [[TotalControl_for_LSL/Events/BOT_SETUP_SUCCESS|BOT_SETUP_SUCCESS]]
* [[AdminBot for Bots/Events|BOT_SETUP_FAILED]]
+
* [[TotalControl_for_LSL/Events/BOT_SETUP_FAILED|BOT_SETUP_FAILED]]
 +
 
 +
== Example ==
 +
 
 +
<syntaxhighlight lang="lsl">
 +
integer BOT_SETUP_SETBOT = 280101;
 +
 
 +
string name = "SmartBots Resident";
 +
string accesscode = "f7dheb7fba9";
 +
 
 +
default
 +
{
 +
state_entry()
 +
{
 +
llMessageLinked(LINK_SET,BOT_SETUP_SETBOT,name,accesscode);
 +
}
 +
link_message(integer sender, integer cmd, string data, key idk) {
 +
string id = (string)idk;
 +
if(cmd == BOT_SETUP_SUCCESS) {
 +
llOwnerSay("Setup Success: data=" + data + "\nkey= " + id);
 +
} else if(cmd == BOT_SETUP_FAILED ) {
 +
llOwnerSay("Setup Failed: data=" + data + "\nkey= " + id);
 +
}
 +
}
 +
}
 +
</syntaxhighlight>
  
 
{{AdminBot for Bots Commands - standard footer}}
 
{{AdminBot for Bots Commands - standard footer}}

Latest revision as of 22:59, 11 March 2019

Sets the working personal Bot. Other commands require this command to be invoked first.

llMessageLinked(LINK_SET,BOT_SETUP_SETBOT,"My bot name","ACCESS CODE");

Variables

The following table shows input values (you send them with the API call) and returned output values.

Variable Required Description


str yes name of the Bot
id yes Access Code

Result

One of the following events will be generated:

Example

integer BOT_SETUP_SETBOT = 280101;

string name = "SmartBots Resident";
string accesscode = "f7dheb7fba9";

default
{
	state_entry()
	{
		llMessageLinked(LINK_SET,BOT_SETUP_SETBOT,name,accesscode);
	}
	link_message(integer sender, integer cmd, string data, key idk) {
		string id = (string)idk;
		if(cmd == BOT_SETUP_SUCCESS) {
			llOwnerSay("Setup Success: data=" + data + "\nkey= " + id);
		} else if(cmd == BOT_SETUP_FAILED ) {
			llOwnerSay("Setup Failed: data=" + data + "\nkey= " + id);
		}
	}
}