What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » auto going on after hibernating

auto going on after hibernating
Author: Message:
davidp
New Member
*


Posts: 7
25 / Male / Flag
Joined: Dec 2008
O.P. auto going on after hibernating
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
12-27-2008 04:50 PM
Profile E-Mail PM Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
30 / Male / Flag
Joined: Jun 2006
RE: auto going on after hibernating
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. ;-)
12-28-2008 11:40 PM
Profile E-Mail PM Find Quote Report
davidp
New Member
*


Posts: 7
25 / Male / Flag
Joined: Dec 2008
O.P. RE: auto going on after hibernating
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...

This post was edited on 12-29-2008 at 12:31 PM by davidp.
12-29-2008 08:19 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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