ScriptCommandTemplate is a template showing how to define an event handler for the "/script" command. The handler can have any function name and many different handlers can be defined for this command.
[string] ScriptCommandTemplate( [object] ChatWnd, [array] Parameters );
A string containing the message to send. If no message should be sent in the chat window in response to the command, return an empty string.
The /script command of Messenger Plus! calls a function in a script. It is used like this:
/script [script\]function [param1] [param2] ... [paramx]
The user can specify the name of the script where the function is located. If no script name is specified, the function is searched and executed in every script that defines it.
The user sends the following message in a chat window:
/script TestCommand "first text" text2
The script handles the event with the following function, displays the parameters in the debugging window and returns an empty string to prevent any message to be sent in the chat.
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 ""; }
Event Source | Messenger Plus! |
---|---|
Availability | Messenger Plus! Live 4.00 |