I've set up some msgplus timers to automatically send voice clips to my contacts, and I want to be able to cancel them by sending a command. This is a portion of the script:
quote:
var ChatWnds = new Array();
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if(Message == "!s"){
ChatWnd.SendMessage("/vc 15");
ChatWnds[ChatWnds.length-1] = ChatWnd;
MsgPlus.AddTimer("Delay1"+[ChatWnds.length-1], 15300);
}
}
function OnEvent_Timer(TimerId){
switch(TimerId.substr(0,6)){
case "Delay1":
ChatWnds[TimerId.substr(6)].SendMessage("/vc 15");
MsgPlus.AddTimer("Delay2"+[TimerId.substr(6)], 15300);
break;
case "Delay2":
ChatWnds[TimerId.substr(6)].SendMessage("/vc 15");
}
}
So, how would I be able to properly call the syntax
MsgPlus.CancelTimer("Delay1"+[ChatWnds.length-1], 15300);
by using a message command?
I've tried several things such as
else if but they have only rendered the script unusable. I'm completely out of ideas and can't find any help in the documentation.