Difference between revisions of "TotalControl for LSL/Events/BOT COMMAND FAILED"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:BOT_SETUP_FAILED}} <onlyinclude>Raised when command error occurs.</onlyinclude> {{API Event Table}} {{API Variable Group|''event'' object properties}} {{API Va...")
 
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) {
   /////////////////// Group setup failed event
+
   /////////////////// Bot command failed event
 
   if(cmd==BOT_COMMAND_FAILED) {
 
   if(cmd==BOT_COMMAND_FAILED) {
 
     // We split the string parameter to the lines
 
     // We split the string parameter to the lines

Revision as of 18:38, 6 July 2016

Raised when command error occurs.

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
str first line - command status code
second line - text explaination
id ---

Example

link_message(integer sender,integer cmd, string data, key id) {
  /////////////////// Bot command failed event
  if(cmd==BOT_COMMAND_FAILED) {
    // 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 explain=llList2String(parts,1);
            
    // Inform user
    llOwnerSay("AdminBot bot command failed:\n"+
      "error code: "+code+"\n"+
      "explaination: "+explain);
  }
}