Difference between revisions of "TotalControl for LSL/Commands/BOT LOGIN"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:BOT_BOT_LOGIN}} <onlyinclude>Initiates bot login process.</onlyinclude> {{API Variables Table}} {{AdminBot Required Vars|BOT_LOGIN}} {{API Variable|str|yes}}...")
 
(Updated example)
Line 1: Line 1:
 
{{DISPLAYTITLE:BOT_BOT_LOGIN}}
 
{{DISPLAYTITLE:BOT_BOT_LOGIN}}
 
<onlyinclude>Initiates bot login process.</onlyinclude>
 
<onlyinclude>Initiates bot login process.</onlyinclude>
 +
 +
<syntaxhighlight lang="lsl">
 +
llMessageLinked(LINK_SET, BOT_LOGIN, "", "");
 +
</syntaxhighlight>
  
 
{{API Variables Table}}
 
{{API Variables Table}}
Line 13: Line 17:
  
 
<syntaxhighlight lang="lsl">
 
<syntaxhighlight lang="lsl">
llMessageLinked(LINK_SET, BOT_LOGIN, "", "");
+
integer BOT_SETUP_SETBOT = 280101;
 +
integer BOT_LOGIN = 280111;
 +
 
 +
integer READY = FALSE;
 +
 
 +
string name = "SmartBots Resident";
 +
string accesscode = "f7dheb7fba9";
 +
 
 +
default
 +
{
 +
state_entry()
 +
{
 +
llMessageLinked(LINK_SET,BOT_SETUP_SETBOT,name,accesscode);
 +
}
 +
 
 +
touch_start(integer total_number)
 +
{
 +
if (READY) {
 +
llMessageLinked(LINK_SET,BOT_LOGIN,"","");
 +
llOwnerSay("The bot will now initiate the login sequence.");
 +
} else {
 +
llOwnerSay("The bot is not ready. If you received a Setup Failed message then please check your access code is correct, otherwise please try again in a moment.");
 +
}
 +
}
 +
 
 +
link_message(integer sender, integer cmd, string data, key idk) {
 +
string id = (string)idk;
 +
if(cmd == BOT_SETUP_SUCCESS) {
 +
READY = TRUE;
 +
llOwnerSay("Setup Success: data=" + data + "\nkey= " + id);
 +
} else if(cmd == BOT_SETUP_FAILED ) {
 +
READY = FALSE;
 +
llOwnerSay("Setup Failed: data=" + data + "\nkey= " + id);
 +
}
 +
}
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 01:28, 13 March 2019

Initiates bot login process.

llMessageLinked(LINK_SET, BOT_LOGIN, "", "");

Variables

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

Variable Required Description


str yes --
id yes --

Example

integer BOT_SETUP_SETBOT = 280101;
integer BOT_LOGIN = 280111;

integer READY = FALSE;

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

default
{
	state_entry()
	{
		llMessageLinked(LINK_SET,BOT_SETUP_SETBOT,name,accesscode);
	}

	touch_start(integer total_number)
	{
		if (READY) {
			llMessageLinked(LINK_SET,BOT_LOGIN,"","");
			llOwnerSay("The bot will now initiate the login sequence.");
		} else {
			llOwnerSay("The bot is not ready. If you received a Setup Failed message then please check your access code is correct, otherwise please try again in a moment.");
		}
	}

	link_message(integer sender, integer cmd, string data, key idk) {
		string id = (string)idk;
		if(cmd == BOT_SETUP_SUCCESS) {
			READY = TRUE;
			llOwnerSay("Setup Success: data=" + data + "\nkey= " + id);
		} else if(cmd == BOT_SETUP_FAILED ) {
			READY = FALSE;
			llOwnerSay("Setup Failed: data=" + data + "\nkey= " + id);
		}
	}
}