ARBITRARY COMMANDS
ARBITRARY COMMANDS
You may define commands that are triggered whenever someone enters a command that matches the command template (wildcarding allowed). These commands are called arbitrary commands, user-defined commands, or $-commands (for how they are defined), and they are checked for only after the check for single-character commands, exits, and internal commands have been performed and have failed (so an arbitrary command that matches ‘page *’ will never be performed).
You define an arbitrary command by storing a string of the form ‘$:
Example:
> @va testobj = $foobar *:"I was foobar'ed with %0.
Set.
> foobar xyzzy
testobj says "I was foobar'ed with xyzzy"
You can prevent individual attributes from being checked for $-commands with the command ‘@set
You can also match a regular expression rather than wildcards. See ‘help Regular Expressions’ for details.
The following attributes are never checked for $-commands: ALIAS CHARGES DESC DROP FAIL IDESC ODESC ODROP OFAIL OSUCC SEX SUCC.
Related Topics: @set.