Shoutbox

event day change - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: event day change (/showthread.php?tid=83697)

event day change by Suxsem on 05-13-2008 at 12:34 PM

hi!
how can I create an event that generate when the day changed (24:00 > event > 24:01)?

without using a timer!

thank, bye!


RE: event day change by mynetx on 05-13-2008 at 12:45 PM

Hello Suxsem,

In fact, using a timer, which is defined by MsgPlus::AddTimer is the only solution to this. Within the OnEvent_Timer callback function, you would have to check if the timer ID is the one for the date timer, then create a Date object, check if the day has changed since the last execution, and then re-add the timer. Also store the current date in registry, using the WScript.Shell object and its RegWrite method, so the next time the callback is called by the timer event, you can compare the current with the stored date.

If you need details on any of these steps, just ask. :)
Regards,


RE: event day change by Suxsem on 05-13-2008 at 12:55 PM

thank! i know use the timer :)
bye!