What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Is it possible...

Is it possible...
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Is it possible...
quote:
Originally posted by Zageron
What is a function that I can use to update it every  seconds?
You should add a timer which does the check every X milliseconds. The following is a template about how you should do this the right way.
code:
var nTimerOffset = 60 * 1000; //Set the timer offset to one minute (1 min = 60 s = 60000 ms)

//The OnEvent_Initialize event calls OnEvent_SigninReady if you're already signed in on script start.
function OnEvent_Initialize(bMessengerStart) {
   if(Messenger.MyStatus > 0) OnEvent_SigninReady(Messenger.MyEmail);
}

//The OnEvent_SigninReady event calls your update function and then creates a timer when you sign in to Messenger.
function OnEvent_SigninReady(sEmail) {
   UpdateIt(); //UpdateIt is your update function
   MsgPlus.CreateTimer("TimerUpdate", nTimerOffset); //Creates a timer
}

//The OnEvent_Signout event cancels the timer.
function OnEvent_Signout(sEmail) {
   MsgPlus.CancelTimer("TimerUpdate");
}

//The OnEvent_Timer event calls your update function and re-creates the timer so it'll create a timed loop.
function OnEvent_Timer(sTimerId) {
   if(sTimerId == "TimerUpdate") {
      UpdateIt(); //Your update function
      MsgPlus.AddTimer(sTimerId, nTimerOffset); //Re-creates the timer
   }
}

function UpdateIt() {
   //Code goes here...
}
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-18-2007 10:04 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Is it possible... - by Zageron on 08-18-2007 at 03:07 AM
RE: Is it possible... - by ShawnZ on 08-18-2007 at 03:08 AM
RE: Is it possible... - by Zageron on 08-18-2007 at 03:10 AM
RE: Is it possible... - by ShawnZ on 08-18-2007 at 03:12 AM
RE: Is it possible... - by Zageron on 08-18-2007 at 03:13 AM
RE: Is it possible... - by ShawnZ on 08-18-2007 at 03:15 AM
RE: Is it possible... - by Zageron on 08-18-2007 at 03:26 AM
RE: Is it possible... - by MeEtc on 08-18-2007 at 03:38 AM
RE: Is it possible... - by Zageron on 08-18-2007 at 03:47 AM
RE: Is it possible... - by roflmao456 on 08-18-2007 at 04:00 AM
RE: Is it possible... - by Zageron on 08-18-2007 at 04:04 AM
RE: Is it possible... - by roflmao456 on 08-18-2007 at 04:05 AM
RE: Is it possible... - by Zageron on 08-18-2007 at 04:13 AM
RE: Is it possible... - by Matti on 08-18-2007 at 10:04 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