Syntax: #ONINPUT pattern commands
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 also use the #SUB command in a trigger to replace parts of your command with other text.


#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. The %* pattern is used to match every character (including special characters). Note that the parser splits up multiple commands *before* running command input triggers. So, with this trigger enabled, the command:
will send
     say hello
to the MUD

Contents OK PATH