BOT_COMMAND_FAILED

From SmartBots Developers Docs
TotalControl for LSLEvents
Revision as of 17:02, 20 March 2019 by Scullyuk (Talk | contribs) (Correction)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 explanation
id ---

Example

link_message(integer sender,integer num, string str, key id) {
  /////////////////// Bot command failed event
  if(num==BOT_COMMAND_FAILED) {
    // We split the string parameter to the lines
    list parts=llParseString2List(str,["\n"],[]);

    // The first line is a status code, and second line is the reason
    string code=llList2String(parts,0);
    string explain=llList2String(parts,1);
            
    // Inform user
    llOwnerSay("TotalControl bot command failed:\n"+
      "error code: "+code+"\n"+
      "explanation: "+explain);
  }
}