EQWatcher Evolution > Anatomy > Variables

An EQWatcher variable is used to temporarily store information.  Variables have a name, such as "MobName" or "Damage" and their data, such as "orc pawn" or 7.   Variable names ARE case sensitive, so "MobName" is completely different than "MobnamE".

A major use of variables in EQWatcher Evolution is to allow for variations in commands and triggers, and of course in scripting -- which is another topic.  The information contained in this section does not refer to the actual scripting language.

EQWatcher allows you to access variables easily in two different ways, depending on whether you want to store information, or retrieve previously stored information.  To store information, the "@" character is placed on both sides of the variable name, such as "@MobName@" or "@Damage@".  Aliases make use of this, such as the alias "speak @ToSpeak@", seen in the core script.  You should recognize this as the command used to speak some text -- try it if you have TTS, execute the command "speak Hi, my name is Bob". The variable "ToSpeak" receives the data "Hi, my name is Bob", which is then used to speak the text.  If you need to retrieve the information from a variable, place the "%" character on both sides of the variable name (%MobName% or %Damage%).  The value is then placed in your command (or wherever it is being used) before execution.  Then, for example, you could do "speak %Damage%" and if the "Damage" variable exists and the value is 7, your command would literally be "speak 7".

EQWatcher Evolution requires all variables to be defined in a script before they are used (and to be specific, they must be defined as public variables to use @variable@ and %variable%).  If the variable does not exist and you use @variable@, the information collected will be thrown out like yesterday's trash (note that the variable "trash" does not exist, and that name is regularly used for useless or arbitrary information).  If the variable does not exist and you use %variable%, it will not be replaced by any information (so if you try "speak %trash%", it will say "percent trash percent", because your command is still literally "speak %trash%".)

For your convenience, there are four pre-defined variables for you to use without having to learn any scripting mumbo jumbo.  They are PSTR1, PSTR2, PINT1, PINT2.  The "STR" ones are "string" variables, which store generic text.  The "INT" ones are numeric variables which have a range of -2,147,483,646 to 2,147,483,647.  These are specifically for your own use, so feel free to use this to your advantage when creating your simple triggers. 

Please note that variables are immediately processed when your command is entered, unless you specifically request that command to NOT process your variables.  To do this, precede the command with "#".  This is useful, for example, for timers and triggers that use variables in their action data.

Again, these methods are not used by the script language.  Variables are processed in this fashion only by the alias parser, the trigger parser, and timers.  The alias and trigger text is passed through the variable processor, as well as the action data from triggers and timers.  For more information on variables and scripting, see that section.