Shoutbox

[Help] program opener - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Help] program opener (/showthread.php?tid=73381)

[Help] program opener by .:lil-wolf:. on 04-07-2007 at 02:04 PM

Chances are there is a program out tehre that does this but i am sorta new to this whole programing thingy and I'm trying to make a program my self and all i'm trying to do is get this to open paint and i got it to open paint but a pop up saying "The Command you entered was not recognized.
If the message was not ment to be a commant, insert a double '//' at its beginning." when i try and use the command. can you help me?

here is what i got for the script:

code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
   
    if(Message=="/paint"){

        var shell = new ActiveXObject("wscript.shell");
        shell.Run("mspaint.exe");

    }

}
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>/paint</Name>';
            commands+='<Description>Open paint.</Description>';
        commands+='</Command>';
    return commands;
}

RE: [Help] program opener by markee on 04-07-2007 at 02:24 PM

Your code was quite good, the only problem was you forgot to return a blank string at the end of calling the command.  I updated the code with this small fix to help you.  Have fun coding ;)

code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
   
    if(Message=="/paint"){

        var shell = new ActiveXObject("wscript.shell");
        shell.Run("mspaint.exe");
        return "";

    }

}
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>paint</Name>';
            commands+='<Description>Open paint.</Description>';
        commands+='</Command>';
    return commands;
}

RE: [Help] program opener by .:lil-wolf:. on 04-07-2007 at 02:28 PM

thanks :D


RE: [Help] program opener by .:lil-wolf:. on 04-07-2007 at 02:39 PM

one more tiny thing. The command isn't showing up on the commands list, why?


RE: [Help] program opener by markee on 04-07-2007 at 02:45 PM

There was a / before paint in the <name> area which was causing the problem because it wasn't needed.  I update the code in the post above so it doesn't have this problem.


RE: [Help] program opener by .:lil-wolf:. on 04-07-2007 at 02:49 PM

oh ok thanks :) i just like entered the code and that never checked the list after entering the code