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:
Err0r
New Member
*


Posts: 3
– / Male / –
Joined: Aug 2006
O.P. Undecided  Online time
Maybe you have seen the online time script. It shows how long you have been online since you logged in in your personal message.
But, is it any way to make a script that stores how long you have been online the last time, and adds that to the online time. It would be funny to see how long i`ve been on msn in 1 year :P

I hope you understand what i mean :P
08-23-2006 05:53 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
RE: Online time
Hi Err0r, sorry, but I thinked that somebody else will answer before me.... :S

I made a script, because I don't want to modify another script :
Go to the MP!L options, "General">"Scripts">"New". Remove everything in the new window, and copy-paste this code. (I think my script works fine....)

code:
function OnEvent_Initialize(MessengerStart) {
    shell=new ActiveXObject("WScript.Shell");
    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_Timer(TimerId) {
    seconds+=10
    shell.RegWrite(regPath+"Seconds",seconds);
   
    yr=parseInt(seconds/31536000);
    mon=parseInt((seconds-(yr*31536000))/2592000);
    day=parseInt((seconds-(yr*31536000)-(mon*2592000))/86400);
    hr=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400))/3600);
    min=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400)-(hr*3600))/60);
    secs=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400)-(hr*3600)-(min*60)));
   
    if (secs>0) {SECONDS=secs+" secondes ";}
    else {SECONDS="";}
    if (min>0) {MINS=min+" minutes ";
        if (secs!=0) {
            MINS+="et "
        }
    }
    else {MINS="";}
    if (hr>0) {HRS=hr+" heures ";}
    else {HRS="";}
    if (day>0) {DAYS=day+" jours ";}
    else {DAYS="";}
    if (mon>0) {MONTH=mon+" mois ";}
    else {MONTH="";}
    if (yr>0) {YEAR=yr+" an ";}
    else {YEAR="";}
    MsgPlus.AddTimer("Timer",10000);
    Messenger.MyPersonalMessage="Cela fait "+YEAR+MONTH+DAYS+HRS+MINS+SECONDS+"que je suis en ligne depuis le 24 Août 2006"; // Here you can modify your message
}

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


This post was edited on 08-24-2006 at 12:24 PM by KnRd_WC.
08-24-2006 12:20 PM
Profile PM Web Find Quote Report
Kenji
Veteran Member
*****

Avatar
Previously: Dazmatic, Dazzy, :zippy:

Posts: 1226
Reputation: 39
32 / Male / Flag
Joined: Jun 2006
Status: Away
RE: Online time
KnRd_WC could you translate this script please?
08-24-2006 12:26 PM
Profile PM Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
RE: Online time
Wow just wait a minute, lol, .parseInt() is only for string, so, at start : 6 years, 10 years, and at 50 seconds my script works fine.... lol I correct this error !
-------------------------
Edit : Mhhhh totally wrong.... .parseInt() works with numbers xD
-------------------------
code:
function OnEvent_Initialize(MessengerStart) {
    shell=new ActiveXObject("WScript.Shell");
    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_Timer(TimerId) {
    seconds+=10
    shell.RegWrite(regPath+"Seconds",seconds);
   
    yr=parseInt(seconds/31536000);
    mon=parseInt((seconds-(yr*31536000))/2592000);
    day=parseInt((seconds-(yr*31536000)-(mon*2592000))/86400);
    hr=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400))/3600);
    min=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400)-(hr*3600))/60);
    secs=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400)-(hr*3600)-(min*60)));
   
    if (secs>0) {SECONDS=secs+" seconds ";}
    else {SECONDS="";}
    if (min>0) {MINS=min+" minutes ";
        if (secs!=0) {
            MINS+="and "
        }
    }
    else {MINS="";}
    if (hr>0) {HRS=hr+" hours ";}
    else {HRS="";}
    if (day>0) {DAYS=day+" days ";}
    else {DAYS="";}
    if (mon>0) {MONTH=mon+" months ";}
    else {MONTH="";}
    if (yr>0) {YEAR=yr+" year ";}
    else {YEAR="";}
    MsgPlus.AddTimer("Timer",10000);
    Messenger.MyPersonalMessage="There are "+YEAR+MONTH+DAYS+HRS+MINS+SECONDS+"since I am connected"; // wow, fu*** translator xD
}


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


Sorry but I used a translator... :S There is a little bug at start, you will see.... but at 50 secs, the script should work fine. I can't correct this error, now, I got to go... :(

This post was edited on 08-24-2006 at 12:38 PM by KnRd_WC.
08-24-2006 12:28 PM
Profile PM Web Find Quote Report
NiteMare
Veteran Member
*****

Avatar
Giga-Byte me

Posts: 2497
Reputation: 37
36 / Male / Flag
Joined: Aug 2003
RE: Online time
quote:
Originally posted by KnRd_WC
function OnEvent_Initialize(MessengerStart) {
shell=new ActiveXObject("WScript.Shell");
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_Timer(TimerId) {
seconds+=10
shell.RegWrite(regPath+"Seconds",seconds);

yr=parseInt(seconds/31536000);
mon=parseInt((seconds-(yr*31536000))/2592000);
day=parseInt((seconds-(yr*31536000)-(mon*2592000))/86400);
hr=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400))/3600);
min=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400)-(hr*3600))/60);
secs=parseInt((seconds-(yr*31536000)-(mon*2592000)-(day*86400)-(hr*3600)-(min*60)));

if (secs>0) {SECONDS=secs+" seconds ";}
else {SECONDS="";}
if (min>0) {MINS=min+" minutes ";
if (secs!=0) {
MINS+="and "
}
}
else {MINS="";}
if (hr>0) {HRS=hr+" hours ";}
else {HRS="";}
if (day>0) {DAYS=day+" days ";}
else {DAYS="";}
if (mon>0) {MONTH=mon+" months ";}
else {MONTH="";}
if (yr>0) {YEAR=yr+" year ";}
else {YEAR="";}
MsgPlus.AddTimer("Timer",10000);
Messenger.MyPersonalMessage="There are "+YEAR+MONTH+DAYS+HRS+MINS+SECONDS+"since I am connected"; // wow, fu*** translator xD
}


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


english translation
code:
Messenger.MyPersonalMessage="I've been connected for "+YEAR+MONTH+DAYS+HRS+MINS+SECONDS; // wow, fu*** translator xD

[Image: sig/]
I'll never forget what she said 6670 days, 19 hours, 27 minutes, 35 seconds ago
Need hosting? Check
out my website. we can help you out :)
08-24-2006 01:17 PM
Profile PM Web Find Quote Report
Err0r
New Member
*


Posts: 3
– / Male / –
Joined: Aug 2006
O.P. RE: Online time
Thanks :D
i`ll test it
08-24-2006 01:37 PM
Profile E-Mail PM Find Quote Report
skyserpent
Junior Member
**

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
RE: Online time
its not showing up in my psm
08-24-2006 01:48 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
Works fine for me.... This script should be better ;)

code:
function OnEvent_Initialize(MessengerStart) {
    shell=new ActiveXObject("WScript.Shell");
    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);
}

Thanks for the translation NiteMare :D

Note : " "+secs+" seconds" >> I could put the space at the end, but the pm will be ".... 20 seconds "<< I don't want this space here ! xD

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

Bacon

Posts: 96
32 / Male / –
Joined: Aug 2006
RE: Online time
Function called: OnEvent_Signin
Function called: OnEvent_Timer
Error: 'shell' is undefined.
       Line: 24. Code: -2146823279.
Function OnEvent_Timer returned an error. Code: -2147352567

help!
08-24-2006 04:24 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
Tongue  RE: Online time
Lol, sorry :

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);
}

08-24-2006 04:44 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