code:
var appenable = false;
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage){
if(sMessage.substr(0,12)=="/shortopener") {
switch(sMessage.substr(13)){
case "enable":
appenable = true;
break;
case "disable":
appenable = false;
break;
default:
appenable = !appenable;
}
MsgPlus.DisplayToast("appenable: " + appenable, "shortopener");
return "";
}
}
function OnGetScriptCommands(){
var Commands = "<ScriptCommands>";
Commands += "<Command>";
Commands += "<Name>shortopener</Name>";
Commands += "<Description>Shortopener \n Enables the shortopener, must be written before starting to use Shortopener</Description>";
Commands += "<Parameters><enable or disable></Parameters>";
Commands += "</Command>";
Commands += "</ScriptCommands>";
return Commands;
}
i would use booleans
and you have to return nothing otherwise it will show that error