What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help with cancelling msgplus timer

Help with cancelling msgplus timer
Author: Message:
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: Help with cancelling msgplus timer
code:
"Delay1"+ChatWnds.length-1
This is not a valid string. "Delay1" is a string and ChatWnds.length is a number, so the plus operator (+) joins them together as a new string object. The -1 is supposed to subtract 1 from a number object, but as "Delay1"+ChatWnds.length is a string, the result is you get a messed up timer ID.

Your original script was correct in putting brackets there:
code:
"Delay1"+[ChatWnds.length-1]
This way, the number is calculated first, then appended to "Delay1". The reason why it probably didn't work was because of the end parentheses for the first if statement.


Also, may I suggest naming your timers something like "ClipxChatx". Then a simple regular expression can be used to handle your timers:
code:
function OnEvent_Timer(TimerId) {
    if(/^Clip(\d+)Chat(\d+)$/.test(TimerId)) {
        var Clip = RegExp.$1;
        var Chat = RegExp.$2;
        aChatWnds[Chat].SendMessage("/vc 15");
        if(Clip < 10) MsgPlus.AddTimer("Clip" + (Clip * 1 + 1) + "Chat" + Chat, 15200);
    }
}
Of course, your method is still valid.

This post was edited on 03-12-2007 at 12:48 AM by phalanxii.
03-11-2007 11:36 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 03:23 AM
RE: Help with cancelling msgplus timer - by matty on 03-11-2007 at 04:49 AM
RE: Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 05:01 AM
RE: Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 05:50 PM
RE: Help with cancelling msgplus timer - by foaly on 03-11-2007 at 06:02 PM
RE: Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 06:07 PM
RE: Help with cancelling msgplus timer - by vikke on 03-11-2007 at 06:19 PM
RE: Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 06:24 PM
RE: Help with cancelling msgplus timer - by foaly on 03-11-2007 at 07:19 PM
RE: Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 08:34 PM
RE: Help with cancelling msgplus timer - by NanaFreak on 03-11-2007 at 08:49 PM
RE: Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 09:30 PM
RE: Help with cancelling msgplus timer - by Ezra on 03-11-2007 at 09:56 PM
RE: Help with cancelling msgplus timer - by Rizu on 03-11-2007 at 10:02 PM
RE: Help with cancelling msgplus timer - by phalanxii on 03-11-2007 at 11:36 PM
RE: Help with cancelling msgplus timer - by foaly on 03-12-2007 at 12:26 PM
RE: RE: Help with cancelling msgplus timer - by phalanxii on 03-13-2007 at 08:19 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On