General EQWatcher Concepts > EQWatcher Anatomy > Triggers
What are triggers?
Triggers tell EQWatcher to do something specific when it sees an event happen in EQ. The way it sees the event happen is via the log file, which is a log of what you see in your chat window. Sorry but if you don't see it in your chat window, EQWatcher will not respond to it or even know about it (unless of course, it is in the NOTES file, which you can read about under aliases). I say this because otherwise people are bound to ask if EQWatcher can tell them how much experience they got per kill. All EQWatcher knows is "You gain experience!!" :)
Generally your triggers will look for some specific text, and then play a sound. This is the simplest form of an EQWatcher trigger, and requires no knowledge of the EQWatcher script language.
Creating a simple trigger
The first thing to do when creating a trigger is figure out the specific text to trigger on. The specific text must account for the entire line shown in the log file, including the date and time stamp. Luckily for you, you don't even have to worry about that. You just have to worry about the part you actually see in the chat window. The text you give must be EXACTLY what is seen in the chat window, and is case sensitive. To make things simpler, you can have EQWatcher ignore sections of the chat window line in the comparison. Even better, you can have it put store text from the ignored sections into a variable for later use (however, I'm not going to explain the use of variables, since this is the triggers section). Say you want to make a trigger for when a mob dies, but you don't care what mob it was. For example you might see "orc pawn dies", and so you can replace "orc pawn" with "@trash@" for your trigger: "@trash@ dies". Now EQWatcher is ignoring everything up to " dies", so any line that ends in " dies" will be a hit for this trigger.
Now that you know what text to tell EQWatcher to look for, you must pick a sound to go with it. Sounds can be .WAV files, CD tracks, MP3s, text-to-speech, or an EQWatcher Advanced command (sure it's not a sound, but it can be attached to the trigger just like sounds can). If you want to play a .WAV file, you must know the path name of the .WAV (in this version, relative path names may not work correctly, so please use the full path name). If you want to play a CD track, you must know the track number. If you want to play an MP3, you must know a search string for the MP3 (see the WinAMP section on playing MP3 by keyword). If you want to give some text to speak, you must know the text you want to speak. If you want to give a command to execute, you must know the command (the sound type for this is "alias").
Now that you have this information ready to use, you can make up a name for the trigger and finally give the command to add the trigger. The command is formatted like this: "trigger [sound type] "[name]" "[text]" [sound information]". The sound type can be one of the following: "wav" "wav sync" "cd" "mp3" "TTS" "TTS sync" "alias". I'm sure your question now is "why is there wav and wav sync? I thought I was just playing a wav". By default, TTS and .WAV files will play asynchronously -- this means that they can be interrupted by the next sound. If you make them "sync" this means they will play synchronously -- this means they will play fully before the next sound. Asynchronous .WAV and asynchronous TTS will play at the same time without interruption. Synchronous sounds can pause or change WinAMP's volume for their duration, since they are considered the "important" sounds, ones that you don't want to miss because your MP3 is playing too loud. The setting for this is on the main window.
Examples:
trigger wav "test wav" "@trash@ dies" c:\windows\media\ding.wav
trigger mp3 "test mp3" "You have slain Trakanon!" queen we are the champions
trigger cd "test cd" "@trash@ tells you, 'WAKE UP'" 1
trigger TTS sync "test tts sync" "You appear." You appear
trigger alias "corpse trigger" "@trash@ dies" timer TTS sync "corpse timer" 7:30 "Corpse rotting soon"
Removing your triggers
Removing your trigger is pretty easy, as long as you remember what you called it. Triggers you created using the "trigger" command are not permanent, so they aren't there to remove after you shut down EQWatcher (if you want to keep triggers, put the add trigger command in a commands file, see that section for information). The command to remove your timer is simply "trigger remove "[name]""
Examples:
trigger remove "test wav"
trigger remove "test mp3"
trigger remove "test cd"
trigger remove "test tts sync"