What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » "/script" command

"/script" command
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: "/script" command
If you want to make a Plus! Live command (like "/me" or "/prefs"), you'll need to use OnEvent_ChatWndSendMessage to look for the command and parse it. The best way to do it is to use CookieRevised's excellent command parsing regular expression, which is explained in CookieRevised's reply to Gettin data from "/" commands.

If you really want to be able to use something like "/script MyFunction 123", the Plus! Live scripting documentation has a template for that:
quote:
Originally posted by Scripting Documentation > Events Reference > Messenger Plus! Events > Events Templates > ScriptsCommandTemplate

Example
The user sends the following message in a chat window:
code:
/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.
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 "";
}

However, it's more recommended to make a "real" command like "/me" than using "/script <function> <parameters>". And honestly, the first method is much faster to type, no? :)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-14-2007 03:52 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
"/script" command - by general sirhc on 10-14-2007 at 03:41 PM
RE: "/script" command - by Matti on 10-14-2007 at 03:52 PM


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