What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Countdown stops when close MSN

Countdown stops when close MSN
Author: Message:
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. Countdown stops when close MSN
Hi.
I have made a script which makes a countdown in my personal message. It works until I close messenger - not log out - close.
When I close it and open it again my countdown stops, but when i log out and log in my countdown works fine.

It is written on danish, but i have you understand what the variables contains ;-)

Here is my code:
code:
function OnEvent_SignIn(Email)
{
    Opdater();
}

function Opdater()
{
    if(Status == "til")
    {
        var Idag = new Date();
        var Dato = new Date(gemAar,gemMaaned - 1,gemDag);
       
        if(Idag >= Dato)
        {
            Messenger.MyPersonalMessage = gemEfterBegivenhed;
        }
        else
        {
            Dato.setHours(gemTimer);
            Dato.setMinutes(gemMinutter);

            var Forskel = Dato.getTime() - Idag.getTime();
   
            var dageForskel = Math.floor(Forskel/1000/60/60/24);
            Forskel -= dageForskel*1000*60*60*24
   
            var timerForskel = Math.floor(Forskel/1000/60/60);
            Forskel -= timerForskel*1000*60*60
   
            var minutterForskel = Math.floor(Forskel/1000/60);
            Forskel -= minutterForskel*1000*60
   
            var sekunderForskel = Math.floor(Forskel/1000);
   
            if(dageForskel == "1")
            {
                var visDage = "dag";
            }
            else
            {
                var visDage = "dage";
            }

            if(timerForskel == "1")
            {
                var visTimer = "time";
            }
            else
            {
                var visTimer = "timer";
            }

            if(minutterForskel == "1")
            {
                var visMinutter = "minut";
            }
            else
            {
                var visMinutter = "minutter";
            }
   
            if(sekunderForskel == "1")
            {
                var visSekunder = "sekund";
            }
            else
            {
                var visSekunder = "sekunder";
            }
   
            Messenger.MyPersonalMessage = dageForskel + " " + visDage + ", " + timerForskel + " " + visTimer + ", " + minutterForskel + " " + visMinutter + " og " + sekunderForskel + " " + visSekunder + gemBegivenhed;
   
            MsgPlus.AddTimer("OpdaterDato",1000);
        }
    }
}

function OnEvent_Timer(Id)
{
    if(Id = "OpdaterDato")
    {
        Opdater();
    }
}

function Vindue()
{
    Popup = MsgPlus.CreateWnd("vindue.xml","WndMain");
    try {
        var x = shell.RegRead(regPath+"Top");
    }
    catch(e) {}
    if (x == 1) {
        Interop.Call("User32.dll","SetWindowPos",Popup.Handle,-1,0,0,0,0,19);Popup.Button_SetCheckState("Chk",true);
    }
}

function OnGetScriptMenu(Location)
{
    ScriptMenu = "<ScriptMenu>";
    ScriptMenu += "<MenuEntry Id=\"indstillinger\">";
    ScriptMenu += "Indstillinger";
    ScriptMenu += "</MenuEntry>";
    ScriptMenu += "<MenuEntry Id=\"tilfra\">";
    ScriptMenu += "Slå til/fra";
    ScriptMenu += "</MenuEntry>";
    ScriptMenu += "</ScriptMenu>";
    return ScriptMenu;
}

function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd)
{
    switch(MenuItemId)
    {
        case "indstillinger":
            try {var x = Wnd_.Handle;};catch(e) {}
            if (x == null){
                Vindue();
            }
            break;
        case "tilfra":
            if(Status == "til")
            {
                Status = "fra";
                Messenger.MyPersonalMessage = oprindeligPb;
                MsgPlus.DisplayToast("Nedtælling","Nedtælling er slået fra.");
            }
            else
            {
                Status = "til";
                Opdater();
                MsgPlus.DisplayToast("Nedtælling","Nedtælling er slået til.");
            }
            break;
    }
}

function OnWndMainEvent_CtrlClicked(Wnd, Handling)
{
    switch(Handling)
    {
        case "knap_gem":
            gemDag = Wnd.GetControlText("input_dag");
            gemMaaned = Wnd.GetControlText("input_maaned");
            gemAar = Wnd.GetControlText("input_aar");
            gemTimer = Wnd.GetControlText("input_timer");
            gemMinutter = Wnd.GetControlText("input_minutter");
            gemBegivenhed = Wnd.GetControlText("input_begivenhed");
            gemEfterBegivenhed = Wnd.GetControlText("input_efterBegivenhed");
            Status = "til";
            Opdater();
            Wnd.Close(0);
            break;
        case "knap_luk":
            Wnd.Close(0);
            break;
    }
}

Thanks in advance.
- Simon
11-30-2006 06:48 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Countdown stops when close MSN - by SnuZZer on 11-30-2006 at 06:48 AM
RE: Countdown stops when close MSN - by NiteMare on 11-30-2006 at 06:58 AM
RE: RE: Countdown stops when close MSN - by CookieRevised on 11-30-2006 at 08:15 AM
RE: Countdown stops when close MSN - by SnuZZer on 11-30-2006 at 01:52 PM
RE: Countdown stops when close MSN - by Spunky on 11-30-2006 at 02:13 PM
RE: Countdown stops when close MSN - by SnuZZer on 11-30-2006 at 03:39 PM
RE: Countdown stops when close MSN - by CookieRevised on 12-01-2006 at 12:25 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