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

Update number of contacts
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Update number of contacts
code:
var _enabled = new Boolean(false);
var oprindeligPB;

function _update_mypersonalmessage(_conversations) {
    var _online = 0;
    var _offline = 0;
    var _total = 0;
   
    for(var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext()) {
       
        if(e.item().Status == 1) { _offline++; }
        else { _online++; }
    }
    var _total = (_online + _offline);
    Messenger.MyPersonalMessage = "Online: " + _online + " | Offline: " + _offline + " | I alt: " + _total + " | Åbne vinduer: " + _conversations;
}

function OnEvent_Initialize(bMessengerStart){
    try{
        oprindeligPB = Messenger.MyPersonalMessage;
    }catch (e){}
}

function OnEvent_SignInReady(sEmail) {
    if (oprindeligPB != Messenger.MyPersonalMessage){ oprindeligPB = Messenger.MyPersonalMessage; }
    if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}

function OnEvent_Uninitialize(bMessengerExit) {
    Messenger.MyPersonalMessage = oprindeligPB;
}

function OnEvent_ContactSignin(){
    if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}
function OnEvent_ContactSignout() {
    if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}

function OnEvent_ChatWndCreated(){
    if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count); }
}

function OnEvent_ChatWndDestroyed() {
    if (_enabled == true) { _update_mypersonalmessage(Messenger.Chats.Count-1); }
}

function OnGetScriptMenu(Location) {
    ScriptMenu = "<ScriptMenu>";
    ScriptMenu += "<MenuEntry Id=\"tilfra\">";
    if (Status == "fra") { ScriptMenu += "Slå til"; }
    else { ScriptMenu += "Slå fra"; }
    ScriptMenu += "</MenuEntry>";
    ScriptMenu += "</ScriptMenu>";
    return ScriptMenu;
}
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd) {
    switch(MenuItemId) {
        case "tilfra":
            if (_enabled == false) {
                _enabled = true;
                MsgPlus.DisplayToast("Kontakt information", "Kontakt information er slået til.");
                _update_mypersonalmessage(Messenger.Chats.Count);
            } else {
                _enabled = false;
                MsgPlus.DisplayToast("Kontakt information", "Kontakt information er slået fra.");
                Messenger.MyPersonalMessage = oprindeligPB;
            }
        break;
    }
}

Would look something like this.

This post was edited on 10-22-2006 at 06:35 PM by matty.
10-22-2006 06:34 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Update number of contacts - by SnuZZer on 10-22-2006 at 03:04 PM
RE: Update number of contacts - by Spunky on 10-22-2006 at 03:25 PM
RE: Update number of contacts - by SnuZZer on 10-22-2006 at 03:46 PM
RE: Update number of contacts - by Spunky on 10-22-2006 at 03:50 PM
RE: Update number of contacts - by SnuZZer on 10-22-2006 at 03:56 PM
RE: Update number of contacts - by Spunky on 10-22-2006 at 05:33 PM
RE: Update number of contacts - by SnuZZer on 10-22-2006 at 05:48 PM
RE: Update number of contacts - by Spunky on 10-22-2006 at 06:03 PM
RE: Update number of contacts - by matty on 10-22-2006 at 06:34 PM
RE: Update number of contacts - by SnuZZer on 10-22-2006 at 07:04 PM
RE: Update number of contacts - by matty on 10-22-2006 at 10:20 PM
RE: Update number of contacts - by SnuZZer on 10-23-2006 at 01:11 PM
RE: Update number of contacts - by Spunky on 10-23-2006 at 01:14 PM
RE: Update number of contacts - by SnuZZer on 10-23-2006 at 01:27 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