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

/ commands
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: / commands
quote:
Originally posted by Mattike
Aaah... here's where regular expressions can help. :-)

I'll try to simplify it for you, since I guess you've never worked with those.
code:
//Register our command
function OnGetScriptCommands() {
...
}

OnGetScriptCommands has got absolutely nothing todo with "registering" a command and is absolutely not needed.

A command is reconized as a command of your script ONLY if you handle it in the ChatWndSendMessage event and return an empty string.

If you do not return an empty string the command line is passed further to other scripts and eventually to Plus! itself. Though this returning of something or an empty string is not mandatory and you can still perfectly 'react' on something the user has typed.

So...
quote:
Originally posted by Mattike
//An example function. Note that you always have to return something to be sent as replacement for the original message.
No you don't. This only depends on what you wanna do and is not mandatory for handling commands (though it is recommended and the 'right' thing todo).

quote:
Originally posted by Mattike
Note: this code is not tested. It's possible that something wasn't noticed while I reviewed my post. If so, please let me know (or you can try to fix it yourself of course)!
For stuff like this always test the code yourself first (and verify the things you claim are correct like "OnGetScriptCommands registers our command").

This post was edited on 02-05-2007 at 01:22 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
02-05-2007 01:16 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
/ commands - by JANiT0R on 02-04-2007 at 05:17 PM
RE: / commands - by Matti on 02-04-2007 at 06:47 PM
RE: RE: / commands - by CookieRevised on 02-05-2007 at 01:16 AM
RE: / commands - by JANiT0R on 02-10-2007 at 09:02 PM
RE: / commands - by roflmao456 on 02-10-2007 at 11:49 PM
RE: / commands - by CookieRevised on 02-11-2007 at 10:25 AM
RE: / commands - by roflmao456 on 02-11-2007 at 03:33 PM
RE: / commands - by CookieRevised on 02-12-2007 at 11:07 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