Status codes
Usage
"Command status codes" are additional information you receive with the TotalControl event.
How to get the code
Events come to your script using link_message:
link_message( integer sender_num, integer num, string str, key id )The Command status code is located in the str variable (while num holds the TotalControl event ID).
Status Codes
The possible status codes are listed below:
Possible events | Status code | Description |
|---|---|---|
Success code | ||
| OK | Command succeed, bot subscription valid. |
Command fails | ||
| UNKNOWN_COMMAND | The command you've sent is unknown. Try upgrading to the most newest version. |
| SERVICE_UNAVAILABLE | This SmartBots service is not available for you. Refer to SmartBots Services page for details. |
| BOT_NOTSET | You are trying to issue the command, but TotalControl does not know your Bot yet (use |
Bot status fails | ||
| BOT_NOTEXIST | The bot you are trying to use does not exist. You have to visit mysmartbots.com and list your personal bot. |
| BOT_WRONGCODE | You have specified the wrong Access Code while setting the bot using |
| BOT_NOTPAID | You've listed your bot with SmartBots, but did not pay your subscription yet. |
| BOT_EXPIRED | Your SmartBots subscription has expired. The expiration date is attached. |
| BOT_NOTSETUP | Editor will process and start your order shortly. Please wait a bit. |
Example
The following example shows how to parse a bot setup error.
In this example, we receive the BOT_SETUP_FAILED event — this means that TotalControl can't use the bot you've specified. We should determine what’s wrong (usually an invalid bot name or an expired subscription).
link_message(integer sender,integer cmd, string data, key id) {
/////////////////// Bot setup failed event
if(cmd==BOT_SETUP_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 expires=llList2String(parts,1);
// Inform user
llOwnerSay("TotalControl bot setup failed:\n"+
"error code: "+code+"\n"+
"expired: "+expires);
}
}