Manipulating Commands Before Sending (Without Sending Them First)

Posted by MageRooster on Sun 19 Aug 2012 07:08 PM — 2 posts, 11,572 views.

#0
So, I have a trigger that catches when someone whispers me and stores the variable, no problem. Currently, I have a reply alias that grabs that variable and responds to them automatically (the MUSH I'm on has a different reply command, but it's picky), but I want to make it a bit better.

What I want to do is if a line starts with 'reply', replace it with 'wh myfriend' when I hit enter WITHOUT sending it. If I hit enter again, since it starts with something other than 'reply', it'll send normally.

Right now I'm trying to fiddle with SetCommand and PasteCommand and that family of commands and while it'll replace the string how I want it, it still always sends the command when I hit enter. Is there some command I'm missing for a 'cancel sending'?
Australia Forum Administrator #1
Check out:

http://www.gammon.com.au/scripts/doc.php?general=plugin_callbacks

In particular: OnPluginCommandEntered

You could use a regular expression to detect the reply and modify it. Or if you don't want to send it, return an empty string, and then use PasteCommand to put it back into the command window (possibly after doing SetCommandSelection).

Or maybe the callback: OnPluginCommand