Triggers

I hate it when I get the message `You are hungry.' and I have to type `get
bread bag' the `eat' bread.  It would be handy if those things could be taken
care of for me, because I am lazy like that.  Triggers are the answer to that
problem.

Edit a connection, and click on the `Triggers' tab.  The `Triggers:' text
area contains the text to match, and the commands text area contain the
commands to execute if the text is matched.  Let's make a new trigger by
clicking the `New' button.  For the trigger text, use 

You are hungry.

And for the commands use

get bread bag
eat bread

(NOTE:  If you made a gbb alias as described in the "aliases" section, then
you could just enter `gbb' and the alias will be executed.)

Now whenever the client receives the text "You are hungry." it will send "get
bread bag" and then "eat bread" to the MUD.  This makes mundane chores
automatic.

Regular Expressions

The full functionality of POSIX regular expressions is beyond the scope of
this documentation.  See the man page (man 7 regex) or search the web for
information.  I will go over some common regular expression briefly, however.

"You are hungry." will ONLY match the text "You are hungry."
"^(.*) tells you '(*)'" will match all tells to you.
"^\[ (.*) un-renting and entering game \]" will match all un-renting log
messages, useful for those imps out there.  Note the '\' characters.  the
square bracket, as well as the circumflex(^), dollar sign, square braces,
squigly breaces ({}) and parentheses are considered special and MUST be
preceded with the '\' character.

Arguments

For each set or "atom" defined in the regular expression, the client stores
the text that was there.  These can be accessed like alias arguments, with a
`&' followed by the argument number.  So, to tell all people that nod at you
"hello", the trigger text would be

^(.*) nods at you.

and the commands would be 

tell &1 Hello.

The `&*' or `&0' argument contain the entire text, so to be annoying you could
do

^(.*) tells you '(.*)'

with the commands

say &*

That's sure to make people happy.

Misc.

It is possible for teh application to be caught in a loop.  Let's say that you
have a trigger that nods at all people that nod at you.  Bob nods at you, and
bob has a trigger that nods all people that nod at him.  You'll both be
nodding at each other until your necks snap, and that kind of MUD resource
usage makes all implementors happy.

