Shoutbox

Confused by the documentation... bear with me. - 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: Confused by the documentation... bear with me. (/showthread.php?tid=86137)

Confused by the documentation... bear with me. by citricsquid on 09-24-2008 at 07:51 PM

I've read through the documentation, but I can't find a clear example of what I want.

I type /hello something and then it runs the function hello and the variable words are assigned "something"

so, /hello starts the command, I know how to do that, but I'm confused by the example.

I have the following in a seperate JS file:

code:
function TestCommand(Wnd, Params)
{
    Debug.Trace("TestCommand has been called");

    var array = VBArray(Params).toArray();
    for(i = 0; i < array.length; i++)
        Debug.Trace(" Parameter: " + array[i]);

    return "";
}


But when I type "/TestCommand fhfhf" it says TestCommand doesn't exist? Have I broken it some how?

I'm rather in a muddle. I have the script doing what I want, it's just setting it up so /script VARIABLE works.
RE: Confused by the documentation... bear with me. by ShawnZ on 09-24-2008 at 08:01 PM

quote:
Originally posted by citricsquid
so, /hello starts the command, I know how to do that

actually, it doesn't :p

look up ongetscriptcommands
RE: RE: Confused by the documentation... bear with me. by citricsquid on 09-24-2008 at 08:10 PM

quote:
Originally posted by ShawnZ
quote:
Originally posted by citricsquid
so, /hello starts the command, I know how to do that

actually, it doesn't :p

look up ongetscriptcommands

arrr, okay, I'll check that out :D
ty.

I can't find anything about this in the documentation? Are you sure it's the correct function?
RE: Confused by the documentation... bear with me. by roflmao456 on 09-24-2008 at 08:44 PM

quote:
Originally posted by citricsquid
quote:
Originally posted by ShawnZ
quote:
Originally posted by citricsquid
so, /hello starts the command, I know how to do that

actually, it doesn't :p

look up ongetscriptcommands

arrr, okay, I'll check that out :D
ty.

I can't find anything about this in the documentation? Are you sure it's the correct function?
it is correct.

Events Reference > Messenger Plus! Events > OnGetScriptCommands

;)
RE: Confused by the documentation... bear with me. by Jesus on 09-25-2008 at 12:01 AM

quote:
Originally posted by roflmao456

it is correct.

Events Reference > Messenger Plus! Events > OnGetScriptCommands

Actually, that won't make the command work. It'll only make it show up in the list that appears when you type a / in the chat window.

To make the command call a function you'll have to catch the command and its parameters in OnEvent_ChatWndSendMessage and make it call a function yourself.
RE: Confused by the documentation... bear with me. by ShawnZ on 09-25-2008 at 02:16 AM

yes, but the documentation for ongetscriptcommands refers you to chatwndsendmessage, whereas chatwndsendmessage doesn't refer you to ongetscriptcommands :p


RE: Confused by the documentation... bear with me. by Volv on 09-25-2008 at 02:22 AM

But if ongetscriptcommands in itself answers no part of the original post then why not direct them straight to chatwndsendmessage?