What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [HELP] wrong timer triggers

[HELP] wrong timer triggers
Author: Message:
LifelesS
Full Member
***


Posts: 115
Reputation: 4
31 / Male / Flag
Joined: Dec 2006
O.P. Huh?  [HELP] wrong timer triggers
Getting nuts with this...:blah:

I have 2 timers, like this:

code:
function OnEvent_ContactSignin(Email)
{
    MsgPlus.AddTimer("ResetAll", 60000);
    if(...){}

    else
    {
        if(...)
        {
            if(...)
            {
                MsgPlus.AddTimer("UnBlocker", 5000);
            }
            else{}
        }   
    }
}

Then outside the ContactSignIn function I have the OnEvent_Timer, like this:

code:
function OnEvent_Timer(UnBlocker)
{
    .....
}

function OnEvent_Timer(ResetAll)
{
    ....
}


and besides the if's and else's, the timer UnBlocker triggers before timer ResetAll, or at least, it should, but it isn't. Everything works except when I had the function for the ResetAll timer... Does it have anything to do with the scope or the order they're declared? :S


P.S. I didn't put all the code, but if it's needed, just say so.

TIA
Best Regards,
Joćo Godinho
07-07-2007 05:46 PM
Profile E-Mail PM Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
34 / Male / Flag
Joined: Oct 2004
RE: [HELP] wrong timer triggers
You're misuing functions (in specific the OnEvent_Timer one). There is only meant to be one instance of OnEvent_Timer in your code which accepts the id of the timer as its parameter:
code:
function OnEvent_Timer(strId)
{
    switch(strId)
    {
        case "UnBlocker":
        .....
        return;


        case "ResetAll":
        .....
        return;
    }
}

This post was edited on 07-07-2007 at 06:22 PM by Volv.
07-07-2007 06:21 PM
Profile PM Find Quote Report
LifelesS
Full Member
***


Posts: 115
Reputation: 4
31 / Male / Flag
Joined: Dec 2006
O.P. RE: [HELP] wrong timer triggers
Many thanks for that... I guess the biggest problem is the fact I'm kind of rusty XD :)
Best Regards,
Joćo Godinho
07-07-2007 06:23 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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