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

Pages: (2): « First « 1 [ 2 ] Last »
Online time
Author: Message:
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
RE: Online time
Error: Expected '}'.
       Line: 63. Code: -2146827279.

cries lol

This post was edited on 08-24-2006 at 04:49 PM by skyserpent.
08-24-2006 04:49 PM
Profile E-Mail PM Web Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
RE: Online time
Are you sure ??? Verify your copy-paste (lol) xD

Sorry for very long posts :S

code:
shell=new ActiveXObject("WScript.Shell");

function OnEvent_Initialize(MessengerStart) {
if (MessengerStart==false) {
regPath=MsgPlus.ScriptRegPath+Messenger.MyUserId+'\\';
Initialize();
}
}

function OnEvent_Signin(Email) {
regPath=MsgPlus.ScriptRegPath+Messenger.MyUserId+'\\';
Initialize();
}

function OnEvent_Signout(Email) {
MsgPlus.CancelTimer("Timer");
}

function OnEvent_Uninitialize(MessengerExit) {
MsgPlus.CancelTimer("Timer");
}

function OnEvent_Timer(TimerId) {
seconds+=10
shell.RegWrite(regPath+"Seconds",seconds);

yr=Math.floor(seconds/31536000);
mon=Math.floor((seconds-(yr*31536000))/2592000);
day=Math.floor((seconds-((yr*31536000)+(mon*2592000)))/86400);
hr=Math.floor((seconds-((yr*31536000)+(mon*2592000)+(day*86400)))/3600);
min=Math.floor((seconds-((yr*31536000)+(mon*2592000)+(day*86400)+(hr*3600)))/60);
secs=Math.floor((seconds-((yr*31536000)+(mon*2592000)+(day*86400)+(hr*3600)+(min*60))));

if (secs>0) {SECONDS=" "+secs+" seconds";}
else {SECONDS="";}
if (min==1) {MINS=" "+min+" minute";}
else if (min>1) {MINS=" "+min+" minutes";}
else {MINS="";}
if (secs!=0&&min>0) {MINS+=" and";}
if (hr==1) {HRS=" "+hr+" hour";}
else if (hr>1) {HRS=" "+hr+" hours";}
else {HRS="";}
if (day==1) {DAYS=" "+day+" day";}
if (day>1) {DAYS=" "+day+" days";}
else {DAYS="";}
if (mon==1) {MONTH=" "+mon+" month";}
else if (mon>1) {MONTH=" "+mon+" months";}
else {MONTH="";}
if (yr==1) {YEAR=" "+yr+" year";}
if (yr>1) {YEAR=" "+yr+" years";}
else {YEAR="";}
MsgPlus.AddTimer("Timer",10000);
Messenger.MyPersonalMessage="I've been connected for"+YEAR+MONTH+DAYS+HRS+MINS+SECONDS;
}


function Initialize() {
try {seconds = parseInt(shell.RegRead(regPath+"Seconds"));} catch(err) {seconds=0;}
MsgPlus.AddTimer("Timer",10000);
}

I verified this script, and, for me, there is no problem... :S

This post was edited on 08-24-2006 at 05:04 PM by KnRd_WC.
08-24-2006 05:03 PM
Profile PM Web Find Quote Report
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
RE: Online time
i have

code:
shell=new ActiveXObject("WScript.Shell");

function OnEvent_Initialize(MessengerStart) {
if (MessengerStart==false) {
regPath=MsgPlus.ScriptRegPath+Messenger.MyUserId+'\\';
Initialize();
}
}

function OnEvent_Signin(Email) {
regPath=MsgPlus.ScriptRegPath+Messenger.MyUserId+'\\';
Initialize();
}

function OnEvent_Signout(Email) {
MsgPlus.CancelTimer("Timer");
}

function OnEvent_Uninitialize(MessengerExit) {
MsgPlus.CancelTimer("Timer");
}

function OnEvent_Timer(TimerId) {
seconds+=10
shell.RegWrite(regPath+"Seconds",seconds);

yr=Math.floor(seconds/31536000);
mon=Math.floor((seconds-(yr*31536000))/2592000);
day=Math.floor((seconds-((yr*31536000)+(mon*2592000)))/86400);
hr=Math.floor((seconds-((yr*31536000)+(mon*2592000)+(day*86400)))/3600);
min=Math.floor((seconds-((yr*31536000)+(mon*2592000)+(day*86400)+(hr*3600)))/60);
secs=Math.floor((seconds-((yr*31536000)+(mon*2592000)+(day*86400)+(hr*3600)+(min*60))));

if (secs>0) {SECONDS=" "+secs+" seconds";}
else {SECONDS="";}
if (min==1) {MINS=" "+min+" minute";}
else if (min>1) {MINS=" "+min+" minutes";}
else {MINS="";}
if (secs!=0&&min>0) {MINS+=" and";}
if (hr==1) {HRS=" "+hr+" hour";}
else if (hr>1) {HRS=" "+hr+" hours";}
else {HRS="";}
if (day==1) {DAYS=" "+day+" day";}
if (day>1) {DAYS=" "+day+" days";}
else {DAYS="";}
if (mon==1) {MONTH=" "+mon+" month";}
else if (mon>1) {MONTH=" "+mon+" months";}
else {MONTH="";}
if (yr==1) {YEAR=" "+yr+" year";}
if (yr>1) {YEAR=" "+yr+" years";}
else {YEAR="";}
MsgPlus.AddTimer("Timer",10000);
Messenger.MyPersonalMessage="I've been connected for"+YEAR+MONTH+DAYS+HRS+MINS+SECONDS;
}


function Initialize() {
try {seconds = parseInt(shell.RegRead(regPath+"Seconds"));} catch(err) {seconds=0;}
MsgPlus.AddTimer("Timer",10000);
}

and i get this in debug

code:
Script is starting
Script is now loaded and ready
Function called: OnEvent_Initialize
Function called: OnEvent_Timer
Error: 'shell' is undefined.
       Line: 25. Code: -2146823279.
Function OnEvent_Timer returned an error. Code: -2147352567
08-24-2006 05:18 PM
Profile E-Mail PM Web Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
RE: Online time
Are you on Win XP ?? Because a friend had the same (no, it was with : new ActiveXObject('UserAccounts.CommonDialog')) problem, and he use Vista Beta 2...
08-24-2006 05:21 PM
Profile PM Web Find Quote Report
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
RE: Online time
i am on XP
08-24-2006 05:23 PM
Profile E-Mail PM Web Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
RE: Online time
Wow, I'm sorry, but I can't help you.... :( That's really strange.... This script works fine for me....

Sorry.......

This post was edited on 08-24-2006 at 05:29 PM by KnRd_WC.
08-24-2006 05:29 PM
Profile PM Web Find Quote Report
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
RE: Online time
:(
08-24-2006 05:30 PM
Profile E-Mail PM Web Find Quote Report
Err0r
New Member
*


Posts: 3
– / Male / –
Joined: Aug 2006
O.P. RE: Online time
Yay. I tested it. And it worked :D Thank you very much :)
08-24-2006 06:22 PM
Profile E-Mail PM Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
Wink  RE: Online time
No problem, it was a pleasure ;)
:cownana:

This post was edited on 08-24-2006 at 06:50 PM by KnRd_WC.
08-24-2006 06:29 PM
Profile PM Web Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« 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