Trigger usage for MudMagic

I     Trigger Definition
II    Trigger Editing
III   Scope of Triggers
IV    Scripting Support
V     Trigger Examples

I. Trigger Definition
-----------------------
A Trigger allows the MudMagic client to automatically execute a command or series of command based on the output of 
your screen. So if you want to congratulate someone everytime they level, you can create a trigger to automatically 
chat a congratulations when the string 'Kelmar has reached level 20' is viewed. To create this type of trigger, a 
little regular expression is required.

There are two types of ways you can set a trigger:
   basic pattern match
   full pattern match

Basic example:
A basic patern match for an event such as:  Flicker tells you 'Hi there'. would appear as:
  Trigger:  tells you
  command:
      print "reply I'm afk"

Pattern example:
A full pattern match with Regex for an event such as: Flicker tells you 'Hi there'.   would appear as:
  Trigger: (.*) tells you '(.*)'.
  command:
      print "tell $1 Sorry I missed your message, I've written it down though"
      print "note to Kyndig;note subject Missed Message from $1"
      print "note + $2"
      print "note post"

The first basic example trigger will execute whenever the words: "tells you" appear on your client screen. The command 
"reply I'm afk" will then be sent.

The second example trigger will execute when the pattern is matched. If you read it carefully, you will see that a 
reply message is sent back to Flicker and a note is posted to Kyndig that a message was missed. The content of the note 
is the message that Flicker sent (or $2 - which is the second argument of the caught pattern )

For help in Regular Expression usage for catching a trigger, visit: http://perldoc.perl.org/perlre.html

II. Trigger Editing
-----------------------
To edit a Trigger, you fill out the Trigger title, Trigger command, and select either a Python script or a local 
command script. For now, the 'Trigger Title' is not used in the client - so inputing anything is fine. 

The Trigger: is either a basic line pattern match:  has entered the game  
             or a regular expression: (.*) has entered the game.

III. Scope of Triggers
-----------------------
  Triggers can be stored as Local game triggers, or Global world triggers. Local game triggers are only available for 
that specific game you are connected to - whereas Global world triggers are available to any game you are connected to. 
For Global Trigger editing - visit: Setting -> Global Settings -> Triggers. 
To edit your local game alias, visit: Profile -> Triggers when connected to a game.

  All triggers are stored and saved on a per-game basis. So each game has its own unique triggers system. Global 
triggers are the only exception to this rule - where they are available to any game.

IV. Scripting Support
-----------------------
Triggers can use either Python or the MudMagic BASIC scripting language. For Python scripts - you would point to the 
file that contains your python script. For using MudMagic BASIC scripting, you would input the BASIC commands in the 
entry field. 
For more details on scripting:
visit Help -> Inline Scripting for MudMagic BASIC 
or Help -> Python Scripting for Python script support details.

 V. Trigger Examples
-----------------------
Triggers allow you to react automatically to text that comes from the MUD. This reaction can be of two forms: sending 
something to the MUD in reply, or there may be no direct interaction with the MUD, but something might be printed in 
the screen, or something else done to call your attention. With the use of Perl PCRE, you can pass arguments to the 
MudMagic command interpreter to perform some BASIC script support if desired. 


    Example 1:
	Trigger Title: something1
	Trigger:  has been killed in battle
	command:
	print "chat comforts"


	The above example will output to your client: chat comforts  If the line: 'has been killed in battle' appears
	on your client screen.

   Example 2:
        Trigger Title: something2
        Trigger: (.*) has been killed in battle
	command:
	print "restore $1"
	print "chat comforts $1"

	The above trigger is like the first example, except it uses regular express to store arguments which can be 
        used in the Mudmagic BASIC command interpreter. If the message:  Kyndig has been killed in battle  appears on 
        your screen the following will be sent:

	restore Kyndig
	chat comforts Kyndig
