What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Uptime script, why doesn't it work?

Uptime script, why doesn't it work?
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Uptime script, why doesn't it work?
Besides the errors shown in the previous posts, there are some other things going on which you need to fix and/or consider:

  1. Do NOT change the PSM every second. Not only will this trigger the messenger server's flood protection and thus it will not work anymore after a while, it is also highly annoying to your contacts. Change the PSM every minute or so...

  2. Read this post regarding the use of timers in scripts!!:
    http://shoutbox.menthix.net/showthread.php?tid=66...d=729576#pid729576

    problem 1) the timer is still triggered whenever another user signs in to messenger, and thus the PSM of that unexpecting user will be changed.

    problem 2) the timer is still triggered even if the user isn't logged in to messenger (offline), which will result in an error since you can't change the PSM in that case.

  3. Instead of triggering the timer each second and manually counting up the different time variables, why not simply get the system date/time when the user signs in. And when you are going to change the PSM (eg: every minute) grab the system date/time again and calculate the difference with the previous value.

    In that way you reduce the overhead and constant triggering of the timer which you now have. And you also don't need those (global) time variables anymore.

    (in fact as the script is now, you don't need all those time variables to be global either, just the seconds must be global, the rest can be calculated from that number (which will also reduce the need of those IF checks and resetting the values etc))

  4. Very minor: if you only use 1 timer you don't need to check the timer id in the OnEvent_Timer function.

  5. You actually don't need to calculate the PC uptime yourself. The uptime can be grabbed from Windows itself as done in following script: [Release] UptimePms

    upsfeup uses a Windows API for this (this script is a dedicated uptime script; the purpose is only to show the uptime in your PSM, including a GUI and options to format the actual string). It does exactly what you want I think.

    Then there is also the Computer Details script from dt, but that currently has a bug in its uptime routine.

    And there are also other threads about uptime scripts. eg:
    online time script
    etc...
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-17-2006 12:18 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Uptime script, why doesn't it work? - by CrAzY_KeBaB on 09-16-2006 at 10:07 PM
RE: Uptime script, why doesn't it work? - by Silentdragon on 09-16-2006 at 10:29 PM
RE: Uptime script, why doesn't it work? - by CrAzY_KeBaB on 09-16-2006 at 11:00 PM
RE: Uptime script, why doesn't it work? - by Silentdragon on 09-16-2006 at 11:13 PM
RE: Uptime script, why doesn't it work? - by CookieRevised on 09-17-2006 at 12:18 AM


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