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

From SmartBots Developers Docs
Jump to: navigation, search
(Undo revision 1305 by Chevonn Edelmann (talk))
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:BOT_EVENT_STATUS_REPLY}}
 
{{DISPLAYTITLE:BOT_EVENT_STATUS_REPLY}}
<onlyinclude>Raised when bot status is recieved.</onlyinclude>
+
<onlyinclude>Raised when bot status is received.</onlyinclude>
  
 
{{API Event Table}}
 
{{API Event Table}}
 
{{API Variable Group|''event'' object properties}}
 
{{API Variable Group|''event'' object properties}}
{{API Variable|str}} [[AdminBot_for_Bots/Documentation/Status_Codes|command status code]], bot expiration date  
+
{{API Variable|str}} first line - [[Usage/Status_Codes|command status code]]<br>second line - bot expiration date  
 
{{API Variable|id}} ---
 
{{API Variable|id}} ---
  
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
+
     // We split the string parameter to the lines
     list parts=llParseString2List(data,[","],[]);
+
     list parts=llParseString2List(data,["\n"],[]);
  
 
     // The first line is a status code, and second line is the bot expiration date
 
     // The first line is a status code, and second line is the bot expiration date
Line 23: Line 23:
 
              
 
              
 
     // Inform user
 
     // Inform user
     llOwnerSay("Got bot status:\n"+
+
     llOwnerSay("Bot status received:\n"+
       "code: "+code+"\n"+
+
       "status code: "+code+"\n"+
 
       "expiration date: "+date);
 
       "expiration date: "+date);
 
   }
 
   }

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);
  }
}