


TinTin #action command
The #action command allows you to tell Pueblo to watch for a certain string of
text from the world. If Pueblo finds that string, the corresponding
command(s) are then executed.
You may turn on echo (with the
#echo command) to see the commands that are being executed when an action occurs.
The #ignore command allows you to toggle whether actions are processed or ignored.
Command syntax
#action
This format will list all defined triggers.
#action {trigger text}
This format will list all triggers that match trigger text. ‘*’ may be used as a
wildcard character. For example, ‘gr*’ matches all triggers that start with the letters ‘gr’.
#action {trigger text} {commands} {priority}
This format will define a new action. Whenever the trigger text is sent from the world, the associated commands will be executed. commands may include world commands, aliased commands, and tintin commands, and
several commands may be specified, separated by semicolons.
The priority may be specified to store some some actions towards the beginning
of the list or towards the end. The priority should be a single digit, from 0
through 9, where 0 is the highest priority and 9 is the lowest. Items with a
higher priority will be stored towards the beginning of the list, and checked
before other items, making them somewhat faster.
Parameter Substitution
The #action command also allows for parameter substitution. You may specify
the variables %0, %1, …, %9 in the trigger text. These variables may then be
used in the command text. Here is an example:
#action {%0 has arrived.} {say Hi %0!}
When the following text is sent by the world:
Coyotl has arrived.
Then the action will be triggered and the following text will be sent to the
world:
say Hi Coyotl!
Anchored triggers
If the trigger text starts with a caret (^), then the match will occur against
the beginning of the line. (This trigger text is said to be ‘anchored’.) For
example, assume the following action:
#action {^Coyote} {#beep}
This will be triggered by any of the following lines:
Coyote has arrived.
Coyote says “Whoa. Who farted?”.
Coyote sniffs the air.
It will not be triggered by the following lines:
Grendel says “Hi Coyote!”
Pingbot thinks that Coyote is a little bit rude.
Dancing_Coyote has arrived.
Note: If a caret is encountered in the trigger text in any position other than the
beginning of the line, the caret is treated as a normal character for matching.
Examples
The following command will define an action that will smile back at someone
when they smile at you. The action is defined as priority 2:
#action {smiles at you} {smile %1} {2}
The following command will list all triggers that have the word ‘smile’ in
them:
#action {*smile*}
The following command (designed for TinyMush) will whisper-emote to anyone who
says something in your presence:
#act {%0 says "%1"} {whisper %0=:is happy that you said "%1".}
(Note that this sort of trigger will get annoying to other users real fast.)
Also see
TinTin wildcards
#echo
#ignore