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

Useful Snippets
Author: Message:
MicroWay
Senior Member
****

Avatar
Do you want me? Try to get me!

Posts: 571
Reputation: 16
36 / Male / Flag
Joined: Jul 2006
Status: Away
RE: Useful Snippets
(Y) Now it's correct

Ohh.. And I edited it a little to display percentage of offline people too. :P I'll post it here:

code:
var online;
var offline;
var percent;
var str;

function OnEvent_SigninReady(Email){
doIt(Email);
}

function OnEvent_ContactSignin(Email){
doIt(Email);
}

function OnEvent_ContactSignout(Email){
doIt(Email);
}

function OnEvent_Initialize(MessengerStart){
doIt(Messenger.MyEmail);
}

function doIt(Email){
str="";
online=0;
offline=0;
var Contacts = Messenger.MyContacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext()) {
var Contact = e.item();
if(Contact.Status!=1&&Contact.Status!=0){
online++;
}
offline++;

}
percent = Math.round((online/offline)*100);
for(var i=0;i<percent;i++){
str=str.replace("-","|");
}
for(var a=0;a<=100;a++){
str=str.replace("-","");
}

percent2 = Math.round(100 - percent);
for(var i=0;i<percent;i++){
str=str.replace("-","|");
}
for(var a=0;a<=100;a++){
str=str.replace("-","");
}
str=str+" "+percent+"% of contacts Online and "+percent2+"% of contacts offline" ;
Messenger.MyPersonalMessage = str;
Debug.Trace(Email +" caused PSM to update");
}


Thanks for this code :D
Sorry for coping it and editing it :$ 

This post was edited on 10-10-2006 at 05:54 AM by MicroWay.
10-10-2006 05:52 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Useful Snippets - by Spunky on 10-10-2006 at 12:04 AM
RE: Useful Snippets - by deAd on 10-10-2006 at 12:09 AM
RE: Useful Snippets - by Spunky on 10-10-2006 at 12:13 AM
RE: Useful Snippets - by MicroWay on 10-10-2006 at 12:28 AM
RE: Useful Snippets - by Spunky on 10-10-2006 at 12:30 AM
RE: Useful Snippets - by MicroWay on 10-10-2006 at 05:52 AM
RE: RE: Useful Snippets - by Spunky on 10-10-2006 at 10:07 AM
RE: Useful Snippets - by CookieRevised on 10-20-2006 at 11:03 PM
RE: Useful Snippets - by Spunky on 10-21-2006 at 12:10 AM
RE: Useful Snippets - by Ezra on 10-21-2006 at 12:33 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