What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [release] Who's online

[release] Who's online
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: RE: [release] Who's online
quote:
Originally posted by alexp2_ad
quote:
Originally posted by Zeh
LOL ok. But isn't there any way of putting each of them in a diferent line with colors? Even if it would take a more complecated code?
No.

Actually, patchou should make a function for a toast that line wraps and uses colours... *-)
Use the newline character like you can in every other string in JScript:

\n

and if that doesn't work try to use:

\x0D

and if that doesn't work, slap Patchou :p

EDIT: and it doesn't work, so let us slap Patchou...



quote:
Originally posted by SpunkyLoveMuff
ALT codes don't seem to go into the script very well (It'd be ALT+0015 for carriage return).
ALT+0015 is certainly not a carriage return. The decimal ascii for a CR is 13 (and thus 0x0D in hexadecimal, see above)...





------------------------------------------

about alexp2_ad's code the code alexp2_ad posted (which isn't his!... ;)@alex):

optimized:
code:
function OnEvent_SigninReady(sEmail) {
    var online = 0;
    var offline = 0;
    for (var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext()) {
        if (e.item().Status > 1) { online++; } else { offline++; }
    }
    MsgPlus.DisplayToastContact('Contact Counter', '[c=green]Online: ' + online + '[/c]\n[c=red]Offline: ' + offline + '[/c]', 'Next count in ' + TimeLength(mytime));
    MsgPlus.AddTimer('reload', mytime) //Replace with SixtyMins if you want an hour
}


function OnEvent_Timer(sTimerId) {
    if (Messenger.MyStatus != 0) {
        OnEvent_SigninReady(Messenger.MyEmail);
    }
}
Extremely important note:

Each and every script that uses timers to manipulate or check user specific stuff should first check if the same user is still signed in when the timer triggers!!!

It should check if it is still the same current user who is signed in and thus only perform the action if the user is the same as the one who started the timer.

Failing todo all this will cause many errors when:
- the user signs out when a timer is still active
- a new user signs in and the action when the timer triggers is something like blocking a contact, changing status, retrieving contacts, etc...

All this because timers do not reset and aren't deleted when somebody signs out or when somebody else signs in.



For this particular script above, the check to see if it is still the current user who started the timer, isn't needed since the SigninReady() event function is used, but every developer should be aware of the above pitfalls.
Extremely many scripts make these faults...

Another, and even better solution for the above problem (for this particular script!) is to explicitly delete the timer when the user signs out:

code:
function OnEvent_SignOut(sTimerId) {
    MsgPlus.DeleteTimer('reload');
}
function OnEvent_Timer(sTimerId) {
    OnEvent_SigninReady(Messenger.MyEmail);
}

This post was edited on 09-15-2006 at 11:22 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-01-2006 09:36 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[release] Who's online - by Jimbo on 08-27-2006 at 05:10 PM
RE: [release] Who's online - by Zeh on 08-27-2006 at 07:37 PM
RE: [release] Who's online - by alexp2_ad on 08-27-2006 at 08:42 PM
RE: [release] Who's online - by Zeh on 08-27-2006 at 08:46 PM
RE: RE: [release] Who's online - by alexp2_ad on 08-27-2006 at 08:51 PM
RE: [release] Who's online - by Zeh on 08-27-2006 at 08:56 PM
RE: RE: [release] Who's online - by alexp2_ad on 08-27-2006 at 09:00 PM
RE: [release] Who's online - by Zeh on 08-27-2006 at 09:02 PM
RE: RE: [release] Who's online - by alexp2_ad on 08-27-2006 at 09:04 PM
RE: RE: RE: [release] Who's online - by CookieRevised on 09-01-2006 at 09:36 AM
RE: RE: RE: RE: [release] Who's online - by alexp2_ad on 09-01-2006 at 10:05 AM
RE: RE: RE: RE: RE: [release] Who's online - by CookieRevised on 09-01-2006 at 05:30 PM
RE: RE: RE: RE: RE: RE: [release] Who's online - by alexp2_ad on 09-01-2006 at 05:38 PM
RE: [release] Who's online - by Zeh on 08-27-2006 at 09:10 PM
RE: [release] Who's online - by Spunky on 08-27-2006 at 11:17 PM
RE: [release] Who's online - by Zeh on 08-28-2006 at 04:05 PM
RE: [release] Who's online - by alexp2_ad on 08-28-2006 at 04:15 PM
RE: [release] Who's online - by Zeh on 08-28-2006 at 04:22 PM
RE: [release] Who's online - by alexp2_ad on 08-28-2006 at 04:40 PM
RE: [release] Who's online - by Zeh on 08-28-2006 at 04:51 PM
RE: RE: [release] Who's online - by alexp2_ad on 08-28-2006 at 04:58 PM
RE: [release] Who's online - by Zeh on 08-28-2006 at 05:02 PM
RE: RE: [release] Who's online - by alexp2_ad on 08-28-2006 at 05:05 PM
RE: [release] Who's online - by Zeh on 08-28-2006 at 05:07 PM
RE: [release] Who's online - by Jimbo on 08-29-2006 at 10:35 AM
RE: [release] Who's online - by Zeh on 08-29-2006 at 12:44 PM
RE: [release] Who's online - by Jimbo on 08-29-2006 at 06:41 PM
RE: [release] Who's online - by dylan! on 08-29-2006 at 07:11 PM
RE: [release] Who's online - by Jimbo on 09-01-2006 at 08:44 AM
RE: [release] Who's online - by CookieRevised on 09-01-2006 at 05:44 PM
RE: RE: [release] Who's online - by alexp2_ad on 09-01-2006 at 06:12 PM
RE: [release] Who's online - by Spunky on 09-01-2006 at 06:28 PM
RE: [release] Who's online - by Felu on 09-01-2006 at 06:34 PM
RE: [release] Who's online - by Jimbo on 09-02-2006 at 09:17 AM
RE: [release] Who's online - by Matti on 09-02-2006 at 09:21 AM
RE: [release] Who's online - by Felu on 09-02-2006 at 09:46 AM
RE: [release] Who's online - by CookieRevised on 09-02-2006 at 10:32 AM
RE: RE: [release] Who's online - by Felu on 09-02-2006 at 10:44 AM
RE: [release] Who's online - by Supersonicdarky on 09-02-2006 at 06:30 PM
RE: [release] Who's online - by Dave on 09-02-2006 at 09:15 PM
RE: [release] Who's online - by CookieRevised on 09-02-2006 at 10:15 PM
RE: [release] Who's online - by Dave on 09-03-2006 at 09:38 PM
RE: [release] Who's online - by CookieRevised on 09-04-2006 at 12:38 AM
RE: [release] Who's online - by Dave on 09-04-2006 at 07:23 AM
RE: [release] Who's online - by Jimbo on 09-07-2006 at 03:15 PM
RE: [release] Who's online - by xxhannahxx on 09-10-2006 at 11:55 AM
RE: [release] Who's online - by NanaFreak on 09-10-2006 at 11:59 AM
RE: [release] Who's online - by xxhannahxx on 09-10-2006 at 12:01 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