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:
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. RE: Update number of contacts
Hej.
I update the number of open windows with af function, wich means that it allways minus one.
This is my code (with danish comments):

code:
var Status = "fra";    // SÆTTER STATUS TIL/FRA
var oprindeligPB = Messenger.MyPersonalMessage; // GEMMER OPRINDELIGE PERSONLIGE BESKED

function OpdaterPB()
{
    if (Status == "til")
    {
        var online = 0;
        var offline = 0;
        var kontakter = Messenger.MyContacts;
        var e = new Enumerator(kontakter);
        for(; !e.atEnd(); e.moveNext()) {
            var kontakt = e.item();
            if(kontakt.Status == "1") {
            offline++;
            } else {
                online++;
            }
        }
        var alle = (online + offline);
        var igang = Messenger.CurrentChats.Count - 1;
        Messenger.MyPersonalMessage = "Online: " + online + " | Offline: " + offline + " | I alt: " + alle + " | Åbne vinduer: " + igang;
    }
}

// NÅR DU LOGGER PÅ : START
function OnEvent_Initialize(MessengerStart)
{   
    opdaterPB();
}
// NÅR DU LOGGER PÅ : SLUT

// NÅR DU LOGGER AF : START
function OnEvent_Uninitialize(MessengerExit)
{
    Messenger.MyPersonalMessage = oprindeligPB;
}
// NÅR DU LOGGER AF : SLUT

// NÅR EN KONTAKTER LOGGER PÅ : START
function OnEvent_ContactSignin()
{
    opdaterPB();
}
// NÅR EN KONTAKTER LOGGER PÅ : SLUT

// NÅR EN KONTAKTER LOGGER AF : START
function OnEvent_ContactSignout()
{
    opdaterPB();
}
// NÅR EN KONTAKTER LOGGER AF : SLUT

// NÅR ET VINDUE ÅBNES : START
function OnEvent_ChatWndCreated()
{
    OpdaterPB();
}
// NÅR ET VINDUE ÅBNES : SLUT

// NÅR ET VINDUE LUKKES : START
function OnEvent_ChatWndDestroyed()
{
    OpdaterPB();
}
// NÅR ET VINDUE LUKKES : SLUT

// LAVER MENU : START
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;
}
// LAVER MENU : SLUT

// VALGT MENU : START
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd)
{
    switch(MenuItemId)
    {
        case "tilfra":
            if (Status == "fra")
            {
                Status = "til";
                MsgPlus.DisplayToast("Kontakt tæller", "Kontakt tæller er slået til.");
                opdaterPB();
            } else {
                Status = "fra";
                MsgPlus.DisplayToast("Kontakt tæller", "Kontakt tæller er slået fra.");
            }
            break;
    }
}
// VALGT MENU : SLUT

This post was edited on 10-23-2006 at 01:49 PM by SnuZZer.
10-23-2006 01:27 PM
Profile E-Mail PM Web 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