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

From SmartBots Developers Docs
Jump to: navigation, search
(Undo revision 1304 by Chevonn Edelmann (talk))
 
Line 13: Line 13:
 
<syntaxhighlight lang="lsl">
 
<syntaxhighlight lang="lsl">
 
link_message(integer sender,integer cmd, string data, key id) {
 
link_message(integer sender,integer cmd, string data, key id) {
   /////////////////// Bot command status reply event
+
   /////////////////// Bot status event
 
   if(cmd==BOT_EVENT_STATUS_REPLY) {
 
   if(cmd==BOT_EVENT_STATUS_REPLY) {
 
     // We split the string parameter to the lines
 
     // We split the string parameter to the lines

Latest revision as of 09:46, 20 May 2017

Raised when bot status is received.

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
str first line - command status code
second line - bot expiration date
id ---

Example

link_message(integer sender,integer cmd, string data, key id) {
  /////////////////// Bot status event
  if(cmd==BOT_EVENT_STATUS_REPLY) {
    // We split the string parameter to the lines
    list parts=llParseString2List(data,["\n"],[]);

    // The first line is a status code, and second line is the bot expiration date
    string code=llList2String(parts,0);
    string date=llList2String(parts,1);
            
    // Inform user
    llOwnerSay("Bot status received:\n"+
      "status code: "+code+"\n"+
      "expiration date: "+date);
  }
}