ONINPUT
Syntax: #ONINPUT id {pattern} {commands} classname options
Related: #TRIGGER
Creates a command input trigger. See the #TRIGGER command for more information on triggers. Instead of matching the pattern against lines received from the MUD, command input triggers test their pattern against commands you enter on the command line. Output from command input triggers will replace the command that you entered.
You can use the #SUB command in the trigger to replace parts of your command with other text.
You can use the #GAG command in the trigger to prevent the command from being echoed to the screen.
You can use the #NOINPUT command in the trigger to completely stop the orginal text from being sent.
If you set the "Prompt" option for the command input trigger, then your trigger script will be executed *before* the command line is parsed by CMUD. This allows you to completely override special characters and control exactly how command line parsing is handled.
ONINPUT Example
#ONINPUT {^h$} {cast 'heal'}
This is just like an alias. Whenever the command 'h' is entered by itself on the command line, the command "cast heal" is sent to the MUD. You should use an #ALIAS for this kind of command since it is more efficient than using command input triggers. But it is the simplest example of an ONINPUT command.
#ONINPUT {^~'(*)} {say %1}
In this example, any command that starts with a single-quote will be converted to a "say" command sent to the MUD. Note that the parser splits up multiple commands *before* running command input triggers. So, with this trigger enabled, the command:
'hello;test
will send
say hello
test
to the MUD |