Shoutbox

auto going on after hibernating - 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: auto going on after hibernating (/showthread.php?tid=87980)

auto going on after hibernating by davidp on 12-27-2008 at 04:50 PM

Hi, I want to ask, how can I do it, that the script goes on after hibernating? It says "Script runnig" in the settings (at scripts) but timers are not running anymore. I always have to restart the script. Is there any solution?

davidp


RE: auto going on after hibernating by felipEx on 12-28-2008 at 11:40 PM

Timers are still running here after suspension. As a "solution", you can create a PlusWnd and subclass it (using PlusWnd::RegisterMessageNotification) and then just look for the WM_POWERBROADCAST (0x0218) Message and  PBT_APMRESUMESUSPEND (0x0007) as wParam value... after that, just add the timer you may need. ;-)


RE: auto going on after hibernating by davidp on 12-29-2008 at 08:19 AM

Thanks for your answer, but I'm a beginner in MSN scripting and don't know how to do that. I just wrote a script, which calculates the time remaining to the start of 2009. The output goes in the "PersonalMessage"-bar. Even when I logout from the messenger and login again, the PersonalMessage-bar is not changing as before. I have to got to the preferences and stop the script and then start again. Maybe I did something wrong, so heres my script:

code:
function OnEvent_Initialize(MessengerStart)
{
var timer=MsgPlus.AddTimer("lauf",1000);
}

function OnEvent_Timer(identifier)
{
var d = new Date();
var dy = ""+d.getDate();
var H = ""+d.getHours();
var m = ""+d.getMinutes();
var s = ""+d.getSeconds();
var year = d.getFullYear();
if(dy.length!=2) dy="0"+dy;
if(H.length!=2) H="0"+H;
if(m.length!=2) m="0"+m;
if(s.length!=2) s="0"+s;

var tage=31-dy;
if(31-dy<10) tage="0"+(31-dy);
var stunden=""+(23-H);
if(23-H<10) stunden="0"+(23-H);
var minuten=""+(59-m);
if(59-m<10) minuten="0"+(59-m);
var sekunden=""+(59-s);
if(59-s<10) sekunden="0"+(59-s);

if(tage.substr(0,1)==0) tage=tage.substr(1,1);
if(stunden.substr(0,1)==0) stunden=stunden.substr(1,1);

if(minuten.substr(0,1)==0) minuten=minuten.substr(1,1);
if(sekunden.substr(0,1)==0) sekunden=sekunden.substr(1,1);
var zeit="";
if(year==2009) zeit="HAPPY NEW YEAR!";
else zeit="Bis Silvester noch "+tage+" Tage, "+stunden+" Stunden, "+minuten+" Minuten und "+sekunden+" Sekunden";
if(identifier=="lauf") Messenger.MyPersonalMessage=zeit;
if(identifier=="lauf") MsgPlus.AddTimer("lauf",1000);
}

function OnEvent_Uninitialize(MessengerExit)
{
}

so what can I do else?

davidp

-- edit: ---
I've found the error: "Error: unknown (Code: -2147418113)
File: Counter.js. Line: 54.
Function OnEvent_Timer returned an error. Code: -2147352567"

on line 54 there is: if(identifier=="timer") Messenger.MyPersonalMessage=timeleft;

Maybe on logging in he can't set the PersonalMessage...