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. Update number of contacts
Hi.
I'm from Denmark and my english isn't good, but i'll try.
I have made a script (..or tried to make a script) which shows how many contacts there's online/offline, how many contacts there's on the list and how many windows there's open.
I have tried to make a timer which update the number in the personal message every second, but it doesn't works.

My script:

var Status = "fra";    // SÆTTER STATUS TIL/FRA
var oprindeligPB = Messenger.MyPersonalMessage;

function OpdaterPB()
{
    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;
    Messenger.MyPersonalMessage = "Online: " + online + " | Offline: " + offline + " | I alt: " + alle + " | Åbne vinduer: " + igang;
    AddTimer("1",100);
}

// NÅR DU LOGGER PÅ : START
function OnEvent_Initialize(MessengerStart)
{   
    if (Status == "til")
    {
        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()
{
    if (Status == "til")
    {
        opdaterPB();
    }
}
// NÅR EN KONTAKTER LOGGER PÅ : SLUT

// NÅR EN KONTAKTER LOGGER AF : START
function OnEvent_ContactSignout()
{
    if (Status == "til")
    {
        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

// TJEKKER TIMER : START
function OnEvent_Timer(id)
{
    if (id == "1")
    {
        opdaterPB();
    }
}
// TJEKKER TIMER : 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 information", "Kontakt information er slået til.");
                opdaterPB();
            } else {
                Status = "fra";
                MsgPlus.DisplayToast("Kontakt information", "Kontakt information er slået fra.");
                Messenger.MyPersonalMessage = oprindeligPB;
                CancelTimer(1);
            }
            break;
    }
}
// VALGT MENU : SLUT


Thanks in advance.
- Simon
10-22-2006 03:04 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