What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Help with choosing a function in menu

[?] Help with choosing a function in menu
Author: Message:
Cartox
Junior Member
**

Avatar
+1

Posts: 87
Reputation: 1
37 / Male / Flag
Joined: Jun 2004
O.P. Happy  [?] Help with choosing a function in menu
I've have this 2 scripts which actually do the same but the other one is with a timer.

function 1:
code:
function OnEvent_Signout(Email){
    new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}

function 2:

code:

function OnEvent_Signout(Email)
{
    MsgPlus.AddTimer("countdown", 10000)

   
}


function OnEvent_Timer(TimerId)
{    new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
   
}

I would like to have these two functions in one script but beeing able to chose  between those 2 and turning it off completely.

exp: Plus! Menu> -Function 1
                            -Delayed function 2
                            -Off

So if function 1 or 2 is selected it may only be activated on signout.

if anyone would like to have a look at it.
thanks :)


EDIT:

I gave it another try, now i get the menu and no errors
but it does not work :)

code:
function OnGetScriptMenu(nLocation) {
    if (nLocation == 1){
     return    '<ScriptMenu>'
        +    '<MenuEntry Id=\"fnormal\">normal</MenuEntry>'
        +    '<MenuEntry Id=\"fdelay\">delay</MenuEntry>'
        +    '<MenuEntry Id=\"foff\">off</MenuEntry>'
        +    '</ScriptMenu>';
    }else{
    return '';
    }
}

function OnEvent_MenuClicked(sMenuId){
    if(sMenuId=="fnormal"){
        MsgPlus.DisplayToast("Menu Click", "Menu Item #1 was clicked!");
function OnEvent_Signout(Email){
    new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}
   
    }
    if(sMenuId=="fdelay"){
        MsgPlus.DisplayToast("Menu Click", "Menu Item #2 was clicked!");
function OnEvent_Signout(Email)
{
    MsgPlus.AddTimer("countdown", 10000)

   
}


function OnEvent_Timer(TimerId)
{    new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
   
}
    if(sMenuId=="foff"){
        MsgPlus.DisplayToast("Menu Click", "Menu Item #3 was clicked!");
}
}
}



This post was edited on 01-28-2007 at 05:59 PM by Cartox.
[Image: cartoxbanr.jpg]

The statement below is True.
The statement above is False.
01-28-2007 12:05 PM
Profile PM Web Find Quote Report
cold12141
New Member
*


Posts: 3
Joined: Jan 2007
RE: [?] Help with choosing a function in menu
Well, I had to clean up that code a lot, but it should work. I'm not sure if the timer after you logout though but eh, worth a shot.
code:
var option = 0;
function OnGetScriptMenu(nLocation)
{
    var ScriptMenu = '<ScriptMenu>';
    ScriptMenu += '<MenuEntry Id=\"fnormal\">normal</MenuEntry>'
    ScriptMenu += '<MenuEntry Id=\"fdelay\">delay</MenuEntry>'
    ScriptMenu += '<MenuEntry Id=\"foff\">off</MenuEntry>'
    ScriptMenu += '</ScriptMenu>';
    return '<ScriptMenu>'
}

function OnEvent_MenuClicked(sMenuId)
{
    if(sMenuId == "fnormal")
    {
        MsgPlus.DisplayToast("Menu Click", "Menu Item #1 was clicked!");
        option = 0;
    }
    if(sMenuId == "fdelay")
    {
        MsgPlus.DisplayToast("Menu Click", "Menu Item #2 was clicked!");
        option = 1;
    }
    if(sMenuId == "foff")
    {
        MsgPlus.DisplayToast("Menu Click", "Menu Item #3 was clicked!");
        option = 2;
    }
}

function OnEvent_Signout(Email)
{
    if(option == 0)
    {
        new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
    }
    else if(option == 1)
    {
        MsgPlus.AddTimer(countdown, 10000)
    }
}

function OnEvent_Timer(TimerId)
{
    if(TimerId = "countdown")
    {
        new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
    }
}
01-29-2007 08:57 AM
Profile E-Mail PM Find Quote Report
Cartox
Junior Member
**

Avatar
+1

Posts: 87
Reputation: 1
37 / Male / Flag
Joined: Jun 2004
O.P. RE: [?] Help with choosing a function in menu
thanks, it works (Y)

the countdown needed some fixing and the menu ,because it didn't show up :)

This post was edited on 01-29-2007 at 04:53 PM by Cartox.
[Image: cartoxbanr.jpg]

The statement below is True.
The statement above is False.
01-29-2007 04:52 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


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