# /trig

Usage:

/TRIG pattern = body
/TRIGP priority pattern = body
/TRIGC chance pattern = body
/TRIGPC priority chance pattern = body

Creates an unnamed macro that will trigger on pattern and execute body. If chance is given with /trigc or /trigpc, it will be the percentage probability of the trigger going off; default is 100%. If priority is given with /trigp or /trigpc, it will be the priority of the trigger; default is 0. The matching style of the trigger is determined by the global variable %{matching}.

If the command fails it returns 0. Otherwise, it creates a new macro and returns its (positive) number (useful in /undefn and /edit).

/trig is equivalent to: /def -t pattern = body.
/trigp is equivalent to: /def -p priority -t pattern = body.
/trigc is equivalent to: /def -c chance -t pattern = body.
/trigpc is equivalent to: /def -p priority -c chance -t pattern = body.

Note: the /trig commands create macros without names. Thus each /trig command will create a new macro macro instead of replacing an old macro. For this reason, it is usually better to use /def and give your macros names.

See: triggers, evaluation, patterns, /def, /untrig

Back to index
Back to tf home page

Copyright © 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004 Ken Keys