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:
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: RE: [Error] AddTimer
I was going to recommend something like this, but then I thought what if there are 2 windows opened at the same time? :)
Solution: You can set the TimerID to ChatWnd, that way, you get one timer for each conversation. Then you also have to separate the "e" variable using an array.

For instance:
code:
var Emoticons;
var e = new Array();
var wnds = new Array();

function send_emoticon(wnd)
{
       if(wnd.EditChangeAllowed==true)
       {
           Emoticons = Messenger.CustomEmoticons;
           e[""+ wnd.Handle] = new Enumerator(Emoticons);
               wnds[""+ wnd.Handle] = wnd; // Stock the chat window
           OnEvent_Timer(""+ wnd.Handle); // launch the timer's loop
       }
}
function OnEvent_Timer(timer)
{
    if(wnds[timer].EditChangeAllowed==true){
        var smile="";
        for(var i = 0; !e[timer].atEnd()&&i<5; e.moveNext(), i++)smile=" "+e[timer].item().Shortcut;
            wnds[timer].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
    }
}


I haven't tried this code, I will do tomorrow. :)
11-10-2007 11:49 PM
Profile E-Mail PM 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