What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Debug needed] Delay Script

[Debug needed] Delay Script
Author: Message:
mickael9
Full Member
***


Posts: 117
Reputation: 3
33 / Male / Flag
Joined: Jul 2005
RE: [Debug needed] Delay Script
code:
var TimerParams  = {};

function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
{
     var regex = /^#Delay;\s?([0-9]+);\s?(.+)$/;
     var match = regex.exec(sMessage);
     if (match)
     {
          var nDelay     = match[1];
          var sMessage   = match[2];
         
          var sTimerName = "timerDelay_" + Math.random().toString().replace(/[^0-9]/,'');
          TimerParams[sTimerName] = {"sMessage" : sMessage, "ChatWnd" : ChatWnd};
         
          MsgPlus.AddTimer(sTimerName,nDelay);
         
          return "";
     }
}

function OnEvent_Timer(TimerId)
{
     if (TimerId.indexOf("timerDelay_") == 0)
     {
          var sMessage = TimerParams[TimerId].sMessage;
          var ChatWnd  = TimerParams[TimerId].ChatWnd;
         
          ChatWnd.SendMessage(sMessage);         
         
          delete(TimerParams[TimerId]);
     }
}

works fine for me (H)
07-12-2006 10:42 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Debug needed] Delay Script - by kjfk on 07-07-2006 at 10:04 PM
RE: [Debug needed] Delay Script - by Dhaya on 07-07-2006 at 10:14 PM
RE: [Debug needed] Delay Script - by kjfk on 07-07-2006 at 10:29 PM
RE: [Debug needed] Delay Script - by J-Thread on 07-07-2006 at 10:57 PM
RE: [Debug needed] Delay Script - by kjfk on 07-07-2006 at 11:03 PM
RE: [Debug needed] Delay Script - by kjfk on 07-12-2006 at 08:31 AM
RE: [Debug needed] Delay Script - by mickael9 on 07-12-2006 at 10:42 AM
RE: [Debug needed] Delay Script - by kjfk on 07-12-2006 at 11:12 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