# BOT_LOCATION

Returns the location of the bot.

```csharp
llMessageLinked(LINK_SET, BOT_LOCATION, "", "");
```

```snippet totalcontrol-variables-EsRYwBUh4J
str | —
id  | —
```


---

## Result

The following event will be raised with the bot's location:

* [BOT_LOCATION_REPLY](/doc/c973534f-9ff1-423a-a50b-37036392a982)


---

## Example

```csharp
integer BOT_SETUP_SETBOT = 280101;
integer BOT_LOCATION = 290232;
integer BOT_LOCATION_REPLY = 290233;

integer READY = FALSE;

string name = "SmartBots Resident";
string apiToken = "bct_...";

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

	touch_start(integer total_number)
	{
		if (READY) {
			llMessageLinked(LINK_SET, BOT_LOCATION, "", "");
			llOwnerSay("Requesting the bot's location.");
		} else {
			llOwnerSay("The bot is not ready. If you received a Setup Failed message, please check your Bot API token and try again.");
		}
	}

	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);
		}
		else if(cmd == BOT_LOCATION_REPLY) {
			list location = llParseString2List(data, ["\n"], []);
			llOwnerSay("Bot (" + name + ") is at: secondlife://" +
				llList2String(location, 0) + "/" +
				llList2String(location, 1) + "/" +
				llList2String(location, 2) + "/" +
				llList2String(location, 3));
		}
	}
}
```