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

Author: Message:
JonnyT
Junior Member
**


Posts: 28
Joined: Jun 2006
for uptime you could use this:

code:
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <darktempler@gmail.com> wrote this file. As long as you retain this notice you
* can do whatever you want with my code. If we meet some day, and you think
* this code is worth it, you can buy me a beer in return - Matt Labrum (-dt-)
* ----------------------------------------------------------------------------
*/
function getUptime(){
    var uptime = wmi('Win32_OperatingSystem').LastBootUpTime;
   
    var start = dateTimetoRealTime(uptime).getTime();
    var now = new Date().getTime();
    var secs = Math.round((now - start) / 1000);

    var st = '';
    var days = removeDec(secs / 86400);
   
    if(days >= 1){
       
        if(days == 1){
            st += days + ' day ';
        }else{
            st += days + ' days ';
        }
       
        secs = secs - (days * 86400);
    }
   
    var hours = removeDec(secs / 3600);

    if(hours >= 1){
        if(hours == 1){
            st += hours + ' hour ';
        }else{
            st += hours-1 + ' hours ';
        }
       
        secs = secs - (hours * 3600)
    }
   
    var mins = removeDec(secs / 60);
   
    if(mins >= 1){
        if(mins == 1){
            st += mins + ' minute ';
        }else{
            st += mins + ' minutes ';
        }
   
        secs = secs - (mins * 60);
    }

    st += 'and ' + secs + ' seconds'

    return st;
}
06-27-2006 09:02 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
- by Zayl on 06-27-2006 at 04:43 PM
- by Zayl on 06-27-2006 at 08:43 PM
- by upsfeup on 06-27-2006 at 08:55 PM
- by JonnyT on 06-27-2006 at 09:02 PM
- by Tartooob on 06-28-2006 at 06:08 AM
- by deAd on 06-27-2006 at 09:04 PM
- by upsfeup on 06-27-2006 at 09:35 PM
- by upsfeup on 06-28-2006 at 03:49 AM
- by Mr. Bougo on 06-28-2006 at 06:11 AM
- by Zayl on 06-28-2006 at 09:19 AM
- by upsfeup on 06-28-2006 at 04:39 PM


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