What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Error] AddTimer

[Error] AddTimer
Author: Message:
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
RE: [Error] AddTimer
You use "MsgPlus.AddTimer("timer",5000);" like a sleeper which stops the loop for 5 seconds. BUT the msgplus's timer is a timer which calls the function "OnEvent_Timer()" when it finish.

So you've to use it like this :

code:
var the_wnd;
var Emoticons;
var e;

function send_emoticon(wnd)
{
       if(wnd.EditChangeAllowed==true)
       {
           Emoticons = Messenger.CustomEmoticons;
           e = new Enumerator(Emoticons);
               the_wnd = wnd;  // Stock the chat window
           OnEvent_Timer("timer_name"); // launch the timer's loop
       }
}

function OnEvent_Timer(timer)
{
    if(timer == "timer_name"){
        var smile="";
        for(var i = 0; !e.atEnd()&&i<5; e.moveNext(), i++)smile=" "+e.item().Shortcut;
            the_wnd.SendMessage(smile); // Send the 5 smilies
            Debug.Trace(smile);
            if(!e.atEnd())MsgPlus.AddTimer("timer_name", 5000); // If not finished yet, recall the function in 5 seconds
    }
}

Hope you understand !

EDIT : Not tried but should works, otherwise it's enough to help you about your project i think. ;)

This post was edited on 11-10-2007 at 11:00 PM by Huhu_Manix.
11-10-2007 10:58 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Error] AddTimer - by Luca on 11-10-2007 at 08:14 PM
RE: [Error] AddTimer - by vikke on 11-10-2007 at 08:26 PM
RE: [Error] AddTimer - by Luca on 11-10-2007 at 09:04 PM
RE: [Error] AddTimer - by Huhu_Manix on 11-10-2007 at 10:58 PM
RE: RE: [Error] AddTimer - by vikke on 11-10-2007 at 11:49 PM
RE: [Error] AddTimer - by Luca on 11-11-2007 at 10:34 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