What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How to make a menu and commands?

How to make a menu and commands?
Author: Message:
Dr Nick
Junior Member
**

Avatar
Firefox > IE

Posts: 59
Reputation: 1
31 / Male / Flag
Joined: Dec 2008
O.P. RE: How to make a menu and commands?
Better, but i renamed the commands, and edited the menu etc, but nothing works.

The commands show up in the command list, but when i enter them, it says the command was not recognised...

Also, when the button in the menu is clicked, the function is not called...

Here is my code...
The code for the menu and command is down the very bottom
XML code:
var originalPSM;
var idleSeconds;
var isIdle;
var isBusy;
var PSMnumber;
var seconds = 60;
 
function OnEvent_Initialize(MessengerStart)
{
    idleSeconds = 0;
    isIdle = false;
    isBusy = false;
    MsgPlus.AddTimer('rotate', seconds * 1000);
}
 
function OnEvent_Uninitialize(MessengerExit)
{
}
 
function updateMessage() {
        if(PSMnumber==1) {
            originalPSM = "Growing old is mandatory, growing up is optional";
            PSMnumber=2;
        } else {
            originalPSM = "There are only two ways to live your life. One is as though nothing is a miracle. The other is as if everything is.";
            PSMnumber=1;
        }
        Messenger.MyPersonalMessage = originalPSM;
}
 
function OnEvent_MyStatusChange(NewStatus)
{
    if( NewStatus == 7 || NewStatus == 6 )
    {
        Messenger.MyPersonalMessage = "Text/ ring me and I'll be back ASAP! 0hrs:0mins:0secs";
        MsgPlus.AddTimer( "incIdle", 1000 );
        MsgPlus.AddTimer( "updateDisplay", 6000 );
        isIdle = true;
        isBusy = false;
    } else if(NewStatus == 4) {
        Messenger.MyPersonalMessage = "Text me! I'm in a full screen app and mssngr alerts are off! :)";
        isBusy = true;
        isIdle = false;
        idleSeconds = 0;
    }
    else
    {
        isIdle = false;
        isBusy = false;
        idleSeconds = 0;
        updateMessage();
        MsgPlus.AddTimer('rotate', seconds * 1000);
    }
}
 
function OnEvent_Timer(sTimerId)
{
    if( isIdle == false && isBusy == false)
    {
        updateMessage();
        MsgPlus.AddTimer('rotate', seconds * 1000);
        return 0;
    }
    else if( sTimerId == "incIdle" )
    {
        if(isIdle==true) {
            idleSeconds ++;
            MsgPlus.AddTimer( "incIdle", 1000 );
        }
    }
    else if( sTimerId == "updateDisplay" )
    {
        if(isIdle==true) {
            var cIdleSeconds = idleSeconds;
            var idleHours = 0;
            var idleMinutes = 0;
           
            while( cIdleSeconds > 59 )
            {
                cIdleSeconds -= 60;
                idleMinutes ++;
            }
           
            while( idleMinutes > 59 )
            {
                idleMinutes -= 60;
                idleHours ++;
            }
   
            Messenger.MyPersonalMessage = "Text/ ring me and I'll be back ASAP! "+idleHours+"hrs:"+idleMinutes+"mins:"+cIdleSeconds+"secs";
            MsgPlus.AddTimer( "updateDisplay", 6000 );
        }
    }
}
 
function OnGetScriptCommands(){
    var oCommand = new Commands();
    with (oCommand) {
        AddCommand('PMrotate', 'Rotate your Personal Message');    }
    return oCommand.ExportCommands();  
}
 
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage) {
    if (/^\/([^\s\/]+)\s*([\s\S]*)$/.exec(sMessage) !== null) {        var _command = RegExp.$1.toLowerCase();
        var _param = RegExp.$2;
        switch (_command) {
            case 'PMrotate':
                if ( _param !== '' ) {
                    updateDisplay();
                } else {
                    updateDisplay();
                }
                break;
        }
    }
}
 
function OnGetScriptMenu(nLocation){
    var oMenu = new ScriptMenu();
       
    with (oMenu) {
        AddSubMenu('My Menu');
            AddItem('/PMrotate', 'Roate your Personal Message');
        CloseSubMenu();
        AddItem('/PMrotate', 'Roate your Personal Message');
    }
    return oMenu.ExportMenu();
}
 
function OnEvent_MenuClicked(sMenuId, nLocation, oChatWnd){
    OnEvent_ChatWndSendMessage(oChatWnd, sMenuId);
}

I also have the two files from Matty
<?
while(!success) { $try++; }
?>
-----------------
Windows 7 Ultimate (6.1.7000)
Windows Live Messenger 14.0.0206
Messenger Plus! Live 4.81.0.358
02-13-2009 06:55 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
How to make a menu and commands? - by Dr Nick on 02-11-2009 at 02:51 AM
RE: How to make a menu and commands? - by matty on 02-11-2009 at 01:46 PM
RE: How to make a menu and commands? - by Spunky on 02-11-2009 at 02:35 PM
RE: How to make a menu and commands? - by matty on 02-11-2009 at 03:18 PM
RE: How to make a menu and commands? - by Dr Nick on 02-12-2009 at 06:30 AM
RE: How to make a menu and commands? - by djdannyp on 02-12-2009 at 10:50 AM
RE: How to make a menu and commands? - by matty on 02-12-2009 at 01:56 PM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 06:55 AM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 06:58 AM
RE: How to make a menu and commands? - by Th3rmal on 02-13-2009 at 07:06 AM
RE: How to make a menu and commands? - by matty on 02-13-2009 at 07:08 AM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 08:08 AM
RE: How to make a menu and commands? - by matty on 02-13-2009 at 01:45 PM
RE: How to make a menu and commands? - by Dr Nick on 02-13-2009 at 11:41 PM
RE: How to make a menu and commands? - by matty on 02-14-2009 at 04:23 AM
RE: How to make a menu and commands? - by Dr Nick on 02-14-2009 at 08:02 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