A trigger is a regexp pattern that is matched against incoming
text from the game server and that issues a set of commands when it is successfully matched.
The body of a trigger can include macros or simple text commands that will be directly sent
to the server. For more information about regexp check out:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html
When received text is matched against the regexp pattern in the trigger every match will be stored inside an array of strings. These matches can be used in scripts and macros and in the trigger command body. The matches are stored into the list as %0, %1, %2 ... %n. %0 is the entire string that the regexp is matched against. %1 is for the first match inside the regexp and so on. In scripts these matches are fetched from the "var" object which is a java.util.ArrayList.
The following commands can be used to manage triggers:
/trig name 'regxp' body
/triglist
/trigtest teststring
/untrig name
/gag name 'regexp' body
/hilite name 'pattern' all|match plain|bold|italic #FFFFFF
/regexpdelim "
The /regexpdelim can be used to change the default ' character that is used around the regexp pattern.
Your triggers are saved in the file: user.dir/batclient/conf/triggers.xml between sessions.
The /gag command can be used to create a trigger that will gag the match. It means that the text will not be printed into the window when there is a regexp match.
You can define triggers directly from the commandline but it is more wise to write scripts that manage your triggers and macros from the void bootup() method inside the script. You can read more about this in the scripting guide.