Difference between revisions of "TotalControl for LSL/Events/BOT LOCATION REPLY"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "link_message( integer sender_num, integer num, string str, key id ) { /////////////////// Bot list group reply event if(num==BOT_LOCATION_REPLY) { // Parse eac...")
 
Line 1: Line 1:
 +
{{DISPLAYTITLE:BOT_LOCATION_REPLY}}
 +
<onlyinclude>Raised when bot returns its location</onlyinclude>
 +
 +
{{API Event Table}}
 +
{{API Variable Group|''event'' object properties}}
 +
{{API Variable|str}} List of roles in the format "region\nx\ny\nz"
 +
{{API Variable|id}} ---
 +
 +
{{API Variables Table End}}
 +
 +
== Example ==
 +
 +
<syntaxhighlight lang="lsl">
 
link_message( integer sender_num, integer num, string str, key id ) {
 
link_message( integer sender_num, integer num, string str, key id ) {
 
     /////////////////// Bot list group reply event
 
     /////////////////// Bot list group reply event
Line 16: Line 29:
 
     }
 
     }
 
}
 
}
 +
</syntaxhighlight>
 +
 +
{{NavMenu}}

Revision as of 11:32, 5 March 2019

Raised when bot returns its location

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
str List of roles in the format "region\nx\ny\nz"
id ---

Example

link_message( integer sender_num, integer num, string str, key id ) {
    /////////////////// Bot list group reply event
    if(num==BOT_LOCATION_REPLY) {
        // Parse each group separated by a new line "\n"
        list location = llParseString2List(str, ["\n"], []);
        integer count;

        // Parse each uuid name combo separated by a ";"
        for(count =0; count < llGetListLength(groups); count++) {
            list botLocation= llParseString2List(llList2String(location, count), [";"], []);
            llOwnerSay("Region: " + llList2String(botLocation, 0));
            llOwnerSay("X: " + llList2String(botLocation, 1));
            llOwnerSay("Y: " + llList2String(botLocation, 2));
            llOwnerSay("Z: " + llList2String(botLocation, 3));
        }
    }
}