English
Chinese
  yTin Online Help  

  Home (english) | Home (chinese) | Downloads | Sample scripts | Online help | Utilities | FAQs | Discussions/Messages | Mud&links | My Progs | Mirrors |
action

format:      #action [{string}] [{command(s)}] [{priority}]

The [] signify optional arguments.

Have the client search for a certain string of text from the mud, if the
client receives that string, it will execute the command(s).   Variables
%0-9 are substituted from the input string, and can be used in the command(s)
side of the command. Previously, all actions were stored alphabetically in the
list, which meant that some of the important actions could exist at the end
of the list (which could result in slow reaction times for those actions).
Priorities have been added to actions now.   The third parameter of the command
will tell how important tintin should reguard this action (0 most important,
9 least important).   If no priority is given, a default value of 5 is assigned.

if the string to be searched for starts with a ^, only the beginning of the
line will be searched.

If #action is typed with no arguments, all actions defined are listed.

If #action is typed with only one argument, actions defined that match that
argument are displayed.   The * character is valid in this case to use
as a 'wildcard'.   See help wildcard.

examples:
#action {Grimmy has arrived} {smile grimmy} {2}
If Grimmy enters the room, you will automatically smile at her.   The priority
setting of two, means that it should be stored close to the top of the list.
(all actions with 1 and 0 set for priorities will be checked before this one).

#action {^TICKCOUNTER: 5 seconds} {sleep} {0}
Since this string is 'anchored', it will only be triggered if it starts at
the beginning of a line.   If your mud has a tickcounter set up like this,
this action will make you sleep at 5 seconds to tick.

#action
list all actions

#action *tell*
list all actions with the word 'tell' in them.

One of the important usage of action's priority is:
Suppose u have:
   #action {dangerous_message} {quit}
Then u see this message:
   XXX tell you: dangerous_message
To avoid the confusion, u can add another higher priority action:
   #action {tell you: } {#nop} {4}

See also: #unaction, #ignore, #substitute, #presub, #toggle stripcolor, #message action