BOT_BOT_LOGOUT

From SmartBots Developers Docs
TotalControl for LSLCommands
Revision as of 01:31, 13 March 2019 by Scullyuk (Talk | contribs) (Updated example)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Initiates bot logout process.

llMessageLinked(LINK_SET, BOT_LOGOUT, "", "");

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_LOGOUT = 280112;

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_LOGOUT,"","");
			llOwnerSay("The bot will now initiate the logout process.");
		} 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);
		}
	}
}