MacroQuest2 Manual
Last Updated: August 24, 2004
http://macroquest.sf.net/

Valid HTML 4.01!

PM Wassup on the MQ website if you have comments or suggestions about the manual

Table of Contents

Introduction
Compiling MacroQuest2
    MQ2Auth
    VC6++
    VC.net
Installing MacroQuest2
MacroQuest2.ini
Starting MacroQuest2
Stopping MacroQuest2
Updating MacroQuest2
Reporting CTD problems
    Example Debug Information
Macro Fundamentals
    Comments
    Pound Commands
    Slash Commands
    MQ2DataVars
    Subroutines
    Custom Events
MacroQuest2 Commands     a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z
MacroQuest2 Data Types
    Members
    Inheritance
    Type Casting

Top Level Objects

AltAbility Bool Me Corpse Cursor Defined Ground FindItem
FindItemBank FindItemBankCount FindItemCount Float GameTime Group GroupLeader GroupLeaderName
Heading If Ini Int InvSlot LastSpawn LineOfSight Macro
Macroquest Math Merchant NamingSpawn NearestSpawn Plugin Raid SelectedItem
Skill Spawn SpawnCount Spell String Switch Target Time
Type Window Zone

Reference Types

altability array buff character ground item plugin skill
spawn spell string switch time timer type window
zone


Immediate Types

argb bool body byte class corpse deity float
heading int invslot ticks race raidmember


Independent Types

currentzone macro macroquest math merchant raid

Common Examples

MacroQuest2 and the UI
    Using Label IDs     Using the tooltype MacroQuest2 CFG Files
MacroQuest2 Plugins
    MQ2Bzsrch
    MQ2Chat
    MQ2ChatWnd
    MQ2CustomBinds
    MQ2EQIM
    MQ2FPS
    MQ2HUD
    MQ2Map
    MQ2Telnet
Creating a MacroQuest2 plugin
Appendix A: Operators
Appendix B: /keypress list
Appendix C: Skills List
Appendix D: Containers List
Appendix E: Slot Names
Spawn Search filters
FAQ

Introduction
MacroQuest2 is a third party program which reduces repetitiveness and enhances the functionality of EverQuest.

MacroQuest2 is as useful as you wish to make it. You can utilize it just for the capabilities of the map and other plugins, or you can further enhance EverQuest through the use of macros or designing your own plugin.

However, there are some issues you need to understand:

First and foremost, the use of MacroQuest2 is a violation of the EULA of EverQuest.

This means that if you do not use MacroQuest2 sensibly, you risk your character being suspended for a period of time, or in extreme cases, having your character permanently banned.

If you are not prepared for such circumstances, stop here and do not continue.

Some suggested reading:

MQ2ChatWnd
Updating MacroQuest2

Compiling MacroQuest2
MacroQuest2 does not come pre-compiled. You must use either VC6++ or VC.net to compile, preferably VC.net. No other compiler is capable of compiling MacroQuest2.

Once you have VC6++ or VC.net installed, you can obtain the MacroQuest2 source files by clicking here.

Ensure that you read the document section about MQ2Auth prior to compiling

MQ2Auth

MAKE SURE YOU UNZIP THE ARCHIVE SO THAT SUBDIRECTIORIES ARE RETAINED.

The creation of MQ2Auth0.h is covered in each of the compiling instructions for each compiler. This section is more of a reference than instructions, but is most helpful for compiling MacroQuest2 for multiple people.

Before you attempt to compile MacroQuest2, you MUST run MQ2Auth.exe on your computer to create a file that allows MacroQuest2 to be compiled. Once MacroQuest2 is compiled, it will only be useable on the computers where the information was added to the MQ2Auth0.h file. Without the MQ2Auth0.h, MacroQuest2 will not compile. If MacroQuest2 is run from a computer that MQ2Auth0.h does not know about, MacroQuest2 will be unusable.

MQ2Auth is a form of protection to restrict the distribution of pre-compiled binaries.

Single user compile
Compiling for friends
The simplest way of creating an MQ2Auth0.h file for multiple people is:

  1. Have Person 1 run (double click) MQ2Auth.exe from their C: drive. This will create an MQ2Auth0.h file on their C: drive
  2. Person 1 passes the MQ2Auth0.h file that was created to Person 2, who places MQ2Auth0.h on their C: drive along with the MQ2Auth.exe program
  3. Person 2 then runs (double clicks) the MQ2Auth.exe, his information is appended to the MQ2Auth0.h file.
  4. Continue until your last friend has run MQ2Auth.exe from their C: drive with the MQ2Auth0.h file, who then passes the MQ2Auth0.h file to the person who will compile MacroQuest2.
  5. The person who is compiling MacroQuest2 can then place the MQ2Auth0.h file in the MQ2Main folder of the MacroQuest2 source directory.
  6. This person then double clicks the MQ2Auth.exe program that exists in the main MacroQuest2 folder to have his information appended to the MQ2Auth0.h file that was placed in he MQ2Main folder.
Compiling MacroQuest2 using VC6++ or Visual Studio 6
  1. Install Visual C++ 6.0 or Visual Studio 6.0
  2. If you are installing VC6++ please make sure you have installed SERVICE PACK 6. You can find Service Pack 6 here: Service Pack 6
  3. Download the MacroQuest2 source files
  4. Unzip it into any new folder
  5. Go to the newly created folder and double click MQ2Auth.exe
  6. Double click macroquest2.dsw file. This will Open Visual C++
  7. Select Build -> Set Active Config and select MQ2main. Click OK
  8. Select Build -> Build MQ2main.dll or press F7
  9. Select Build -> Batch Build. Make sure everything in the batch build window that says release has a check by it.
  10. Click the Build button. All should compile with no errors or warnings.
Compiling MacroQuest2 using VC.net
  1. Download the MacroQuest2 source files
  2. Unzip it into any new folder
  3. Right click the folder, select Properties, and remove the Read only flag
  4. Double-click MQ2Auth.exe. This will create the file necessary for compiling MQ2 in the MQ2Main folder.
  5. Double-click the Macroquest2.sln file. VC.net will open the MacroQuest project
  6. Go to the Build menu and select Configuration Manager
  7. Select Release, and place a check in each dll you want compiled. Click the Close button
  1. Go to the Build menu and select Build Solution
  2. The dll files will compile and be placed in the Release folder.
Installing MacroQuest2

After compiling Macroquest2:
  1. Create a new folder anywhere, such as c:\MQ2
  2. Create four new folders within this folder, named configs, ini, logs, and macros
  3. Copy the Macroquest2.exe, the compiled dll's, the ini files, and the .txt files from the Release folder to c:\MQ2:
You should have a directory similar to that shown below:



MacroQuest.ini

MacroQuest.ini contains settings related to the operation of MacroQuest2. Depending on your usage of MacroQuest2, the file may change.

You are also able to edit this file manually to change the behavior of MacroQuest2.

One entry of note is LaxColor=0

If you set LaxColor=1, and you run macro's, be prepared for some text that some may consider offensive if your macro has errors in it.
This option is not intended to make people angry. If you don't like what you see, change it back to LaxColor=0

Starting MacroQuest2

MacroQuest2 can be started anytime before you start EverQuest, or after you start EverQuest.

To run MacroQuest2 double click on MacroQuest2.exe from the Release folder, or from where you installed MacroQuest2.

An icon will(should) appear in your system tray.



Right clicking on the icon allows you to:
  1. Access other web sites
  2. Access the MacroQuest2 forums
  3. View the Readme
  4. Edit your MacroQuest2 ini file
Stopping MacroQuest2

MacroQuest2 can be stopped at any time by typing /unload in the EverQuest client, then right clicking the icon in the system tray and selecting exit.

Do not close Macroquest2 without typing /unload in the EverQuest client first. If you do, EverQuest will crash.

Updating MacroQuest2

When there is a patch to the EverQuest eqgame.exe be sure check the forums to see if there has been a change to MacroQuest2.

DO NOT visit the MQ2 website and post that MQ2 is broken on a patch day if a new eqgame.exe was pushed.

You have been warned!!!

Occasionally, the MacroQuest2 developers also update current features or add new features to MacroQuest2.

Download the latest zip file and recompile when this occurs.

Link to MacroQuest2 forums: Forums.

Link to the current latest zip: MQ2-Latest.zip.

Reporting CTD problems

When reporting a Crash to Desktop, or CTD, the MacroQuest2 developers need information about the crash from a debugger.

If you cannot get this information, please find someone who can get the information. It does no good to post on the MQ2 forums about a CTD without it.

First and foremost, to be of help you MUST attach a debugger. Here is the information needed:
  1. We need to know the actual error. The address, the address that was probably trying to be read, etc. Copy and paste from the debugger.
  2. We need to know if the crash itself was in EVERQUEST, or MACROQUEST2. If it was in MacroQuest2, the debugger will show you the source line. If not, it will show you some disassembly and an offset in eqgame.exe (most likely).
  3. Inside MacroQuest - The error information from #1 as well as the source line that caused the crash. If you can, copy and paste us the surrounding code block and let us know which source file it was in (e.g. MQ2Utilities.cpp)
  4. Inside EverQuest - The error information #1 including the offset in eqgame.exe, copy and paste a couple lines of the disassembly if you can, AND GET THE FUNCTION CALL STACK. If we get the function call stack, it may be VERY easy to fix the problem. If not, may be very DIFFICULT to fix the problem.
Debuggers
What you need to know about debuggers:
  1. How to attach a debugger to the process, and how to enable trapping of the 0xC0000005 exception (the majority of crash bugs)
  2. Where to find the debug spew as well as crash information (for #1) when eqgame.exe crashes
  3. Where to find the source line (for #2a) when eqgame.exe crashes inside MacroQuest2
  4. Where to find the disassembly (for #2b) when eqgame.exe crashes
  5. Where to find the function call stack (for #2b) when eqgame crashes


Visual Studio .NET

  1. Debug menu->Processes option. In the "Available Processes" list. Select eqgame.exe
  2. Click "Attach". In the "Attach to Process" box that pops up, select only "Native" in the list. Click OK. The popup closes and the debugger attaches. Click "Close" in the processes window.
  3. To enable trapping of the 0xC0000005 exception, open Debug->Exceptions (alternatively ctrl+alt+E). Expand "Win32 Exceptions". Select "c0000005 Access violation". Select the two "Break into the debugger" options. Click OK.
  4. Debug spew can be found in the "Output window" by pressing ctrl+alt+O, or by going View->Other Windows->Output. The crash information will be displayed there when eqgame.exe crashes.
  5. VS.NET will automatically point to the source file and put a green arrow by the source line that caused the problem, assuming MacroQuest2 was compiled on the computer you are running this on.
  6. If the disassembly does not show up, you can switch to the disassembly window by hitting alt+8 or by going debug->windows->disassembly
  7. The function call stack can be found in the toolbar that contains "Program", "Thread" and "Stack Frame". The call stack will be seen in the "stack frame" combo box. Pull it down and take note of the top few if not the entire list.
Visual Studio 6 (and for you retarded monkeys, VISUAL C++ 6.0 IS IN THIS CATEGORY)

  1. Build menu->Start Debug->Attach to process...
  2. Check the "Show System Processes" button. Select "eqgame.exe" in the list. Click OK.
  3. The c0000005 exception trapping can be enabled by going Debug->Exceptions. Select c0000005 Access violation. Click "Stop always". Click Change. Click OK
  4. Debug spew can be found in the "Output window" by hitting alt+2, or by going View->Output. The crash information will be displayed there when eqgame.exe crashes.
  5. VS6 should automatically point to the source file and put a green arrow by the source line that caused the problem, assuming MacroQuest2 was compiled on the computer you are running this on.
  6. If the disassembly does not show up, you can switch to the disassembly window by hitting alt+8 or by going View->Debug Windows->Disassembly
  7. The function call stack can be found in the "Call Stack" window, found by pressing alt+7 or by going View->Debug Windows->Call Stack
Example Debug information

When you post the information, please make sure you have some kind of arrow pointing to the specific line where the error occured. In the example below is used to indicate the relative lines.

Debug Output Spew

[MQ2]Echo - [MQ2] no combat - ending
[MQ2]WriteChatColor([MQ2] no combat - ending)
[MQ2]WriteChatColor(Cleared the following: Timers Arrays)
[MQ2]EndMacro - Ended
[MQ2]WriteChatColor(The current macro has ended.)
>>>First-chance exception at 0x03002e30 (MQ2Main.dll) in eqgame.exe: 0xC0000005: Access violation reading location 0x0127bde8.

Call Stack

>>>MQ2Main.dll!HideDoCommand(EQData::_SPAWNINFO * pChar=0x423338e8, char * szLine=0x0127bde8, int delayed=0) Line 118 + 0x9 C++
MQ2Main.dll!DoNextCommand() Line 40 C++
MQ2Main.dll!Heartbeat() Line 255 + 0x5 C++
MQ2Main.dll!Detour_ProcessGameEvents() Line 270 C++
eqgame.exe!004acd5f()
ntdll.dll!77f944a8()
ntdll.dll!77f57d70()
ntdll.dll!77f58a3a()
ntdll.dll!77f5d760()
ntdll.dll!77f8696d()
ntdll.dll!77f59bf9()
ntdll.dll!77f5d90e()
ntdll.dll!77f5d8e2()
ntdll.dll!77f944a8()
ntdll.dll!77f944a8()
ntdll.dll!77f57d70()
ntdll.dll!77f58a3a()
Code where the crash occurred

MQ2CommandAPI.cpp (line 118)
if (Pos==0) {
if (pCommand->Parse) {
pCommand->Function(pChar,ParseMacroParameter(pChar,szParam));
}
else
pCommand->Function(pChar,szParam);
   >>>strcpy(szLastCommand,szLine);
return;
}

Disassembly

pCommand->Function(pChar,szParam);
03002E15 mov eax,dword ptr [pChar]
03002E18 lea edx,[esp+1018h]
03002E1F push edx
03002E20 push eax
03002E21 call dword ptr [esi+40h]
03002E24 add esp,8
strcpy(szLastCommand,szLine);
03002E27 mov edx,offset _szLastCommand (3075528h)
03002E2C mov eax,ebx
03002E2E sub edx,ebx
>>>03002E30 mov cl,byte ptr [eax]
03002E32 mov byte ptr [edx+eax],cl
03002E35 inc eax
03002E36 test cl,cl
03002E38 jne HideDoCommand+340h (3002E30h)
return;
Macro Fundamentals

The use of macros is what makes MacroQuest2 extremely powerful. The only thing limiting your use of the macro commands and variables is your imagination.

The use of macros in MacroQuest2 is very similar to programming. The scripting language involves the use of slash commands (/command)and variables.

Slash commands perform an action, while the MacroQuest2 Top Level Objects, data types, and variables help you access and manipulate information in the game.

The creation of a macro involves creating an Entry point into the macro, as shown below:

Sub Main


/return

Everything within Sub Main is performed once you start the macro.

Comments

Comments are descriptive lines in a macro to make reading easier. These are not executed when the macro runs.

Single line comments start with |
|This is a single line comment
Multi line comments can also be used. Multi-line comments begin with |** and end with **|
|** This is a multiple line comment where
you could use this form of commenting **|
Pound Commands
Pound commands are pre-execution commands that are not run during the macro.

#turbo [#]
This will prevent bad macros from locking up the client by allowing you to limit the number of commands per iteration. The default is 20, while the maximum value is 40. A value of 1 will essentially disable #turbo.

#turbo is active with the default of 20 in all macros even if you do not use #turbo in your macro.

#define replaceme replacement
Replaces all occurrences of replaceme with replacement throughout the macro.
Example
#define Me charactername
When the macro executes, when Me occurs, it will be replaced with charactername
#include "filename"
Allows you to use functions from another macro file by using /call.

Normally the filename extension .inc is used to indicate that it is an include file, but you may use any extension name that you like.

Subs present in an include file are accessible by the calling macro as if the Sub existed within the calling macro.

#event eventname "string"
Creates a custom event (Sub Event_eventname) that occurs whenever string is sent to the chat box.

Example
#event SpellFizzle "Your spell fizzles"

Matching Sub:

Sub Event_SpellFizzle


/return
A matching Sub must be used. Custom events are further explained in Subroutines.

Slash Commands

Slash commands in MacroQuest2 are essentially a scripting language. The use of these commands are what allows you to automate tasks.

The list of commands available and their descriptions is under the section MacroQuest2 Commands

MQ2DataVars

MQ2Data was designed so that accessing information could be done utilizing a uniform system. User variables are utilized as MQ2Data Top-Level Objects.

About Types
User variables can be declared as any MQ2DataVars type, however there is no reason to create a variable that is an independent type such as the macroquest type, although it will work.

Scopes
There are three scopes used by macros.

global
Variables of global scope ALWAYS exist until they are deleted or macroquest ends

outer
Variables of outer scope exist while a macro is running

local (default)
Variables of local scope only exist while within a macro function or "Sub"

Commands specific to user defined variables

/declare varname|varname[array extents] [type] [local|global|outer] [defaultvalue]
Creates a variable within a particular scope and of a particular type. The parameters must be given in order, but any after varname may be skipped to use the default.

  1. The default type is string
  2. The default scope is local
  3. The default value is nothing (empty string, or 0)
These variables can be of any type that exist in MQ2DataVars. The variable will then have access to the members of that type.

Examples

/declare MyVar int outer
Creates an int variable named MyVar that exists while the macro is running

/declare MyVar local
Creates a string variable named MyVar that exists within the Sub it was created in

/declare MyTimer timer outer 3000
Creates a timer named MyTime that is set to 3000 at creation and exists while the macro is running
Arrays

To create an array, attach brackets to the end of the variable name and place in it the number of elements per dimension.

Array Examples

MyArray[10] int
Creates a single-dimension local array of int with 10 elements (1-10) all 0

MyArray[10,10] int outer 5
Creates a 2-dimensional 10x10 elements(1-10,1-10) int array of scope outer with all values of 5

MyArray[4,5,6] string outer UNDEFINED-ARRAY-ELEMENT
Creates a 3-dimensional array with 4x5x6 elements (1-4,1-5, 1-6) with UNDEFINED-ARRAY-ELEMENT in each location
There is no limit to the number of dimensions or the number of elements in each dimension, but use your own good judgement.

Note: You cannot make an array of timers.

/deletevar varname [*|global]
Deletes the variable varname. Using * global will delete all global variables.

/varset varname [newvalue]
Sets a variable directly to a new value. Keep in mind that the type itself may reject this value depending on what you give it. To clear the value of the variable, you may omit the new value.

Examples

/varset MyString ${MyString}stuff
concatenate a string variable

/varset MyString stuff${MyString}
inserts stuff at the front of ${MyString}

/varset MyInt 123
Sets MyInt to 123

/varset MyTimer 123s
Sets MyTimer to 123 seconds

/varset MyFloat 1.23
Sets MyFloat to 1.23

/varset MyIntArray[n] 123
Sets array element n to 123

/varcalc varname formula
Sets a variable directly to the numeric result of a calculation. Keep in mind that the type itself may reject this value depending on what you give it. This will NOT work on strings!

Examples

/varcalc MyInt 1+2*2+1

/varcalc MyInt 1+(2*2)+1
/vardata varname newMQ2Datavalue
Sets a variable directly to the end result of a MQ2Data string. To use this, do NOT put ${} around the outer data to parse
This is most useful for when you want to keep the result of something instead of trying to make the variable accept a string with /varset.

Example

/vardata MyFloat Math.Calc[${Me.X}+${Me.Y}]
Parsing

It is important to note that parsing of variables is performed from the inside to the outside, so any ${} inside your MQ2Data usage get evaluated before continuing.

Example

${MyString${MyVar}}
The parser first evaluates ${MyVar}. If MyVar's value is 1, this is then ${MyString1}.
${MyString1} is then evaluated, giving the value of whatever MyString1 is.
${${MyString}} will get the value of a MQ2Data query stored in MyString. This could be Me.Buff[1], or a variable name, or anything that is valid inside ${}. There is no limit to this recursion.

${${${${${${${${${${MyString}}}}}}}}}} will evaluate inside to outside until there is nothing left to evaluate.

This is also true for arrays: ${MyArray[${MyInt}]} has no problems.

Subroutines

Every macro has a Sub Main that defines the macro's entry point. Sub Main accepts parameters if desired.

Sub Main
.
code
.
/return

Additional Subs can be defined and used with /call. /return will return to the statement after the /call.

All subroutines and Sub Main accept passed in parameters. Some information you need to remember is:
  1. You do not have to define parameters for a sub
  2. Parameters passed to a Sub without defined parameters will default to Param0, Param1, ... Paramn
  3. Default parameters are of type string
  4. If you define the parameters of a Sub, the parameters can be of any data type that exists in MQ2DataVars
  5. If the type of a defined parameter is not given, it will default to string
  6. When you define the parameters, you may use the parameter names as variables in the sub
  7. If parameters are undefined, you would use Param0, Param1,...Paramn as the variable names
Sub Main(int MyParam1, MyParam2, float MyParam3)
/if (${Defined[MyVar2]}) /goto :DoThis
/call MySub ${var1} ${var3}
/echo This value was returned from MySub: ${Macro.Return}
/return
Sub without defined parameters

Sub MySub
/if (${Defined[Param0]}) /goto :DoThis
.
execute this code when /call MySub is executed. Parameters are not necessary.
.
/return [value|${varname}]
Sub with defined parameters

Sub MySub(int MyParam0, bool MyParam1, MyParam2)
.
execute this code when /call MySub is executed.
.
/return [value|${varname}]
The above Sub has 3 Parameters, MyParam0 is an int type, MyParam1 is a boolean type , and MyParam2 is a string type.

Special subroutines (Chat, Timers, and Custom) starting with Event_ are used in conjunction with the command /doevents

Chat Events

Sub Event_Chat[(ChatType,Sender,ChatText)]

ChatType : Channel of message (tell, group, say)
Sender : Name of the person who sent the message
ChatText : Text they sent

Example

Sub Event_Chat[(ChatType,Sender,ChatText)]
.
This code is executed when /doevents finds(queues) text in the channel defined by #chat "channel"
.
/return [value|${varname}]
Timer Events

Sub Event_Timer[(Timer,OriginalValue)]
Timer: Timer that fired
OriginalValue : Value timer was originally set to
Example

Sub Event_Timer[(Timer,OriginalValue)]
.
This code is executed when /doevents detects(queues) any defined timer reaching 0
.
/return [value|${varname}]
Custom Events

The new Custom Event system requires that you use the entire line of chat, BUT allows for making sections of the line a parameter.

Old Event system
#Event SelfEcho "[MQ2] Genbot "

Here is what the new Event look like:
#Event SelfEcho "[MQ2] Genbot #1#"
The #1# in the middle of the match text is what you use to indicate "this part of the message should be given to me in a parameter".
The number between the # signs says what parameter number you want this to be in your Sub Event_Whatever.

The first parameter in the sub will be the entire line itself... 1 starts AFTER that. e.g. this event could look like this:

    Sub Event_SelfEcho(string Line, string Command)

Imagine this is the text that matches the event text:

    "[MQ2] Genbot THIS IS MY COMMAND"

The two parameters are:

    Line=[MQ2] Genbot THIS IS MY COMMAND
    Command=THIS IS MY COMMAND

The system also allows you to grab a MQ2Data value like this:

    #Event SelfEcho "[MQ2] Genbot |${Me}| #1#"

The system itself has no idea that MQ2Data even exists, and is just looking for the | or #.

MQ2 makes it parse what's inside the || as MQ2Data when the system checks to see if the event is a match.

So, this event would only hit when, if ${Me} is currently "Lax", the message starts like..

    "[MQ2] Genbot Lax whatever"

Notes:
  1. Because this system lets you pick the parameter number of any portion of the message, some parameters might not get made (e.g. wont be ${Defined}... it's up to you to make sure you get the ones you need defined.
  2. The MQ2Data is not immediately parsed when the event is made, it gets parsed when the system checks to see if the event is a match.
  3. If you need to SKIP a portion of the text (dont care about it, just need to ignore part of the text that might not match, whatever), you can use #*#.
Example

#Event SkillUp "You have become better at #1#! (#2#)"

Sub Event_SkillUp(SkillUpText,Skill,int Amount)
/popup ${Skill} increased - ${Amount} ...
/echo ${Skill} increased - ${Amount} ...
/return

SkillUpText = "You have become better at #1#! (#2#)"
Skill = Parameter 1 = #1#
Amount = Parameter 2 = #2#
MacroQuest2 Commands

/aa [list all|timers] [info abilityname] [act abilityname]
used to retrieve information on AA Abilities, or to activate an AA ability

list all Lists all AA abilities available to you (doesn't mean you have them) in format [ID : name]
list timers Lists just the AA you have that have timers
info abilityname Gives information about a particular AA ability
act abilityname Works like "/alt act ##", but takes the name instead of ## (note: You will notice a fraction of a second delay using this method vs. the /alt act ## method.)

/alert add # [pc|npc|corpse|any] [radius #] [range lowerlevel upperlevel] "spawnname" [clear|list #]
Used to manipulate alert lists which 'watch' for spawns.


Examples
/alert add 1 "spawnname" Adds spawnname to alert list 1
/alert clear # Clears all members from alert list 1
/alert list # Lists all members of alert list 1
/alert add 1 npc radius 300 'spawnname' Sets alert(1) to TRUE if 'spawnname' is within radius of 300 from your location
/alert add 2 npc range 30 200 'spawnname' Sets alert(2) to TRUE if any 'spawnname' are within 30 to 200 range from your location
/alias [list|delete aliasname] [name command]
Useful for creating shorter versions of a command.
/alias list
Lists all aliases

/alias /hp /echo My health is ${Me.PctHPs}
Typing /hp in the EQ chat box will display: My health is % in the EQ chat window

/alias delete aliasname
Deletes aliasname from Macroquest.ini
/alt command
Execute a command while telling the window manager that the alt key is pressed. Can also be used together with /ctrl and/or /shift, as in /ctrl /alt /shift command

/banklist
Displays an inventory of the currently logged in character in this format:

Bankslot#:Typeofcontainer
-ContainerSlot1:Item
-Containerslot2:Item
-etc

/beep
Performs a system beep

/bind [ list | eqlist ] | [~]name [ keycombo| clear ]
list Lists all MQ2 binds
eqlist Lists all Everquest binds
name keycombo Binds name to the normal key combination keycombo
~name keycombo Binds name to the alternate key combination keycombo
name clear Clears the key combination from name
~name clear Clears the alternate key combination from name

keycombo can be any combination of "alt", "shift" and "ctrl" plus a key.

Examples:
/bind forward e Binds the forward command to key e
/bind ~forward up Binds the forward command to alternate key uparrow
/bind forward clear Clears the key used for the forward command
/bind '/bind cast1 shift+1 Binds ''Cast gem 1'' to shift 1 key combination

Note: Changing EQ binds will not immediately update the display in the options window. Change the bind
list selection in the options window to see the updated keys.

/buyitem #
Buys # of the items selected in the merchant inventory (stackable only)

/call subroutine [Param0... [Param#]]
Calls a subroutine (defined by Sub <name>)

Examples
/call MySub Executes Sub MySub
/call MySub varname1 varname2 ...[varname#] Executes Sub Mysub and passes parameters
/caption list|type value|update #
Command that sets the custom captions from in-game. Using this command will also change the ini settings for the particular level.

EQ itself constantly updates the name of every spawn in the zone, even though only a small portion of those are displayed. Using /caption allows you to modify how many spawn captions updated. The default setting for /caption update is 35.

Also see NamingSpawn

Player1 through Player4 in MacroQuest.ini are directly related to which /shownames level you use.

Player1 is linked to /shownames 1
Player2 is linked to /shownames 2
Player3 is linked to /shownames 3
Player4 is linked to /shownames 4

Example

Player1=${If[${NamingSpawn.Trader},Trader,]}${If[${NamingSpawn.Invis},(${NamingSpawn.DisplayName})

Use "\n" to add a new line when setting captions


To use the default (EQ settings) clear the specific setting(Player1-Player4) in the ini using:

/caption Player1

You can also configure Player1 - Player4 from the EQ client using:

/caption Playern configsettings
Example

/caption update 20
Sets the number of nearest spawns for MQ2 to update the name of each pass to 20. By default, this is 35.
Look at the Macroquest.ini file in the zip file under [Captions] for examples of configuring Player1-Player4.

/captioncolor list | [name off|on|# # #]
Allows a lot of custom spawn caption coloring.

The caption of marked NPCs or assist NPCs can be a specific color, the caption of bankers and merchants can be a set color.
NPCs can be done by con color. All spawns can be done by CLASS color (using the raid settings).

Note that you can only set the raid class colors right now through the raid options window. You can open this window by typing /windowstate raidoptionswindow show

Examples

/captioncolor list
/captioncolor pcclass on
/captioncolor pctrader on
/captioncolor pctrader 255 128 0
name that can be used
PC OFF (Default color for PCs)
PCCon OFF (PCs by con color)
PCPVPTeam OFF (PCs by PVP team color)
PCRaid OFF (Raid members))
PCClass OFF (PCs by class color(raid settings))
PCGroup OFF (Group members))
PCTrader ON Color: 255 127 0. (Traders)
NPC OFF (NPC default color))
NPCCon ON (NPCs by con color))
NPCClass OFF (NPCs by class color (raid settings))
NPCMerchant ON Color: 255 127 0. (NPC Merchants)
NPCBanker ON Color: 200 0 255. (NPC Bankers)
NPCAssist ON Color: 255 255 0. (NPCs from main assist))
NPCMark ON Color: 255 255 0. (Marked NPCs)
PetNPC OFF (Pet with NPC owner)
PetPC OFF (Pet with PC owner)
PetClass OFF (Pet by class color (raid settings))
Corpse OFF (Corpses))
CorpseClass OFF (Corpse by class color (raid settings))
/cast ["spellname"|"${varname}"] [list] [item "itemname"]
Will cast the specified spell, or perform a right click of an item that has a right click spell
/cast "complete heal"
/cast item "mana robe"
/cast "${SpellName}"
/cast list

/charinfo
Returns Your current bind zone and location.
You are bound in zonename at x, y, z

/cleanup
Closes all open windows and then opens inventory window

/clearerrors
Clears each of the "last errors" in the macroquest type

/click left|right [corpse|target|windowloc] [ [+-]x [+-]y ] ]
Clicks the left/right mouse button at coordinates or a defined location.

Examples
/click left Performs a left mouse click at the current mouse position
/click left 100 100 Performs a left mouse click at 100 100
/click left +30 -30 Performs a left mouse click 30 pixels right and 30 pixels up from the current location
/click right target Performs a right click on your current target
/combine packn
Activates the Combine button combine of pack
Example

/combine pack8
/ctrl command
Execute a command while telling the window manager that the ctrl key is pressed. Can also be used together with /alt and/or /shift, as in /ctrl /alt /shift command

/custombind list [add|delete bindname] [set|clear bindname [-down|-up] command(s)]
Example usage (NOTE: MQ2's very first bind command is "RANGED" so you do not need to do this, but for example)

/custombind add mybind
/custombind set mybind /ranged
/bind mybind n

Binds the /ranged command to the n key
/declare varname global | local | timer | array | array2
Sets varname as a global, local, timer, one dimensional array or two dimensional array

/defaulthud
Loads the default HUD. See MQ2HUD for specifics.

/delay  # | ${varname} [s | m] [condition]
Fully pauses macro for a set amount of time. #|${varname} is in 10ths of a second (or suffixes s/m)
Examples
/delay 5 Delays the macro execution for 5 tenths of a second
/delay 1s Delays the macro for 1 second
/delay 1m Delays the macro for one minute
Example of condition usage:

/keypress forward hold
/delay 1s ${Spawn[1234].Distance}<${Spawn[1234].MaxMeleeTo}
/keypress forward

Will execute /keypress forward when ${Spawn[1234].Distance}<${Spawn[1234].MaxMeleeTo} evaluates to TRUE or after 1 second passes.

/deletevar name [* global]
Deletes an existing variable. Gives a message if the variable did not exist, but no message if the variable did exist.

Using * global will delete all global variables.

/destroy
Destroys whatever you have on your cursor. Use with care. [Not an MQ2 command but placed in the documentation for reference]

Example:

/if (${Cursor.Name.Find[rusty]}) /destroy

/docommand

Example

/docommand ${If[${Me.Sitting},dotrue,dofalse]}

/doevents [flush | specificevent]
Runs any events that have queued up or flushes queued events
If specificevent is used, only those events will run (/doevents chat )
Examples
/doevents chat doevents will only run chat events
/doevents flush Clears all events in the /doevents queue
/doevents SpellFizzle doevents will only run SpellFizzle events
/doors ["filter"]
Lists all doors in the zone

/doortarget id# | "filter"
"Targets" a door for use with /face door

/dosocial

/drop
Drops the item currently on the cursor

/dumpbinds name
Dumps all current binds to Configs\name.cfg which can be used to load later.

/echo text
Echo's the specified text and or variable values to the EQ client

Example:

/echo My current health is at ${Me.PctHPs}

/endmacro
Stops the macro

/face [predict] [fast] [nolook] [away] [alert # | loc y,x | heading angle | item | door | id # | name]
Turns your character to face your target
Using look will change your view elevation to face and look at the target at it's z axis location
Using predict will return estimated distances, unless the target is stationary
Examples

/face Turns you to face and look at your selected target
/face nolook Faces your target without changing your vertical view angle
/face fast Immediately turns your character to face and look at the target
/face fast predict Immediately turns your character to face and look at the target's estimated position
/face fast nolook Immediately turns your character to face your target without changing your vertical view angle
/face fast nopredict Immediately turns your character to face and look at your target's estimated position
/face item Faces and looks at the item from /itemtarget
/face fast item Immediately faces and looks at the item from /itemtarget
/filter [macros all|enhanced|none] [skills all | increase | none] [target | money | food | encumber | debug on | off] [name [add text] | remove ] [zrange #] [mq on|off]

/for varname val1 to|downto val2 [step val3]
Runs commands while changing varname from val1 to val2 in steps of val3 (default is 1)
/for varname value1 to|downto value2 [step val3]
.
commands
.
/next varname
/goto :labelname
Moves macro execution to a label
/goto :MyLabel
/help macro
Lists all commands available to the client

/hud normal|underui|always
Adds additional functionality to the MQ2 HUD. See MQ2HUD for more details

/highlight "spawnname" [color # # #] [reset]
Temporarily highlights these spawns on the in-game map

/highlight color # # #

Sets the highlight color to an RGB value

Note: You can use search filters for spawnname

/identify
Cross between the Identify spell and right-clicking an item for info

/if (conditions) { command(s) } Runs command(s) if conditions evaluates to TRUE.

conditions are ONLY numeric compares. You must use MQ2Data string comparison to turn string compares into numeric compares.

conditions gets evaluated down to a single term from however many terms there are (You may use && and || freely.)

Multiple commands can be surrounded by { }, allowing multiple commands to be executed if the comparison is true. } can be followed by else and a command. (also see /multiline)
Example

/if (${String[${firstvar}].Equal[This is true]}) {
/echo TRUE
} else /if (!${secondvar}) {
/echo FALSE
/mqlog secondvar equals: ${secondvar}
} else {
/echo It's Something else
}
/ini "ini filename" "keyname" "valuename" "value"
Writes data to the specified ini file. Also see the Ini TLO
Example

stuff.ini contains:

[MySection]
Key1=123
Key2=This is cool!
Key3=Wheeee... 15

/ini "stuff.ini" "Section2" "ANewKey" "Some Data!"

stuff.ini after the above command is executed:

[MySection]
Key1=123
Key2=This is cool!
Key3=Wheeee... 15

[Section2]
ANewKey=Some Data!
/itemnotify [in] location [slot#] notification
Similar to the /click function, but does not involve the use of the mouse.
slot can be an inventory slot name, while slot# can be pack1-pack8, bank1-bank16 (sharedbank1,
sharedbank2 and trade1-trade8 are not yet implemented in /itemnotify)
notification can be:

leftmouse No action
leftmouseup Removes the item and puts it on cursor (same as left clicking it)
leftmouseheld For making hotkeys (you know, hold down left button)
leftmouseheldup No action
rightmouse No action
rightmouseup Casts the effect, or opens the container (same as right clicking it)
rightmouseheld Opens item display window
rightmouseheldup Closes the item display window for that item
Examples:

Exchange of item in primary slot:
   /itemnotify pack8 leftmouseup
   itemnotify mainhand leftmouseup
   itemnotify pack8 leftmouseup

Click grim aura earring:
   itemnotify rightear rightmouseup
/items ["filter"]
Lists all ground spawns in the zone if "filter" is not used

/itemtarget "itemname"
"Targets" a ground spawn or environmental container

/itemtarget <"itemname">

/keepkeys [off|on]
Keeps keys that were pressed with /keypress in their current state when a macro ends.

/keepkeysGives the state of keepkeys

/keypress name [hold]
/keypress is used strictly for the keys that are mapped by the EQ client. /keypress does not actually emulate
the key being pressed and therefore will not interfere if you're typing. See Appendix D for the list of mapped key names
See /press or /sendkey for using unmapped keys.

Examples
/keypress jump Taps the key mapped as the jump key
/keypress forward hold Holds down the mapped forward key
/keypress forward Releases the mapped forward key after /keypress forward hold
Note: /keypress works with EQ key binds as well as MQ2 keybinds. See /bind

/listmacros ["filter"]
Lists macro files that are in the 'macros' directory (listed alphabetically)

/loadcfg filename command
Loads a cfg file

* Plugins can use LoadCfgFile(filename)
* Configs that are automatically loaded:
AutoExec.CFG
Executed on the first pulse

CharSelect.CFG
Executed when you are put at character select

server_character.CFG
Executed when this character enters the world

mapshortname.CFG
Executed when you zone into this zone

pluginname-AutoExec.CFG
Executed when this plugin is loaded (after its initialization is complete)


Examples of file names:
tallon_lordsoth.cfg
character

oot.cfg, soldungb.cfg, soldunga.cfg, take.cfg
maps

MQ2Map-AutoExec.CFG, MQ2ChatWnd-AutoExec.CFG
plugins
/loadhud hudname
Loads a HUD with the name hudname from the ini. See MQ2HUD for specifics.

/loadspells "spellset"
Will load one of your memorized sets of spells

/location
Returns your x,y location and the cardinal direction you are facing.

Resulting message: Your Location is x, y, z, and are heading south

/loginname
Displays the login name of the account you are currently logged into

/look [[-]angle]
Changes the angle you are looking. <angle> can be any value between -128 and 128. Default for <angle> is 0.
Examples
/look 50 Changes your look angle to +50
/look -75 Changes your look angle to -75 (down)
/macro filename [Param0 [Param1...]]
Starts running a macro. Calling a macro from another macro will end the calling macro.

/macro mymacro
/macro mymacro "water flask" "metal bits"

/mapclick keycombo commandoption
command and special right click commands (hold a combination of shift, control, left alt, right alt to execute a special command when right clicking on a spawn). Defaults include left-alt right-click to highlight and control r-click tohide. (Requires MQ2Map plugin to be loaded)

Example

/mapclick lalt+shift /mycommand %i
leftalt+shift right click on a spawn will cause /mycommand to be executed.
/mapfilter help|option [color R# G# B#] (Requires MQ2Map plugin to be loaded)

Map filtering options :
All Enables/disables map functions
CastRadius # Sets radius of casting circle to # (omit or set to 0 to disable)
Corpse Displays corpses
Custom Sets custom filter (omit to disable). Used same search options as /target and the Spawn search TLOs
Ground Displays ground items
Group Displays group members in a specific color
Help Displays the available options for /mapfilter
Menu Allows display of right-click context menu
Mount Displays mounts
NormalLabels Toggles non-MQ2 label display
NPC Displays NPCs
NPCConColor Displays NPCs in consider colors
PC Displays PCs
PCConColor Displays PCs in consider colors
Pet Displays pets
Target Displays your target
TargetLine Displays a line to your target
TargetMelee # Draws a melee-range circle around your target
TargetRadius # Sets radius of a circle around your target to # (omit or set to 0)
Timer Displays Timer objects on the map
Trap Displays trap objects on the map
Trigger Displays hidden triggers/traps
Untargetable Displays untargettable spawns on the map
Vector Displays heading vectors

/maphide "spawnname" [reset] (Requires MQ2Map plugin to be loaded)
Command to hide spawnname from the map. Hidden spawns are in effect until the mapped spawns are re-generated (such as changing some map filters)

Examples

/maphide reset
Re-generates the spawn list.

/maphide npc range 1-39
Hides all spawns level 39 and below
/mapnames normal|target options (Requires MQ2Map plugin to be loaded)
Sets the way real spawn names are displayed for a) your current target, or b) normally.. You can set up a custom scheme using special "%" codes made up just for this.

The command takes a parameter specifying normal/target, and then the custom string. The plugin will replace the %l %r %c %N stuff with a piece of information. Each code is CASE SENSITIVE and exactly one character in length. It is important to note that names are NOT updated continually, except for your target if the target map filter is on. In testing the system was approximately 4 times as slow if all names were updated continually.

Here are a few examples as a guide

/mapnames normal [%l %R %C] %N

/mapnames target [%l %R %C] %N (%x, %y, %z)
Current % codes (more may be added later)

n "Decorated" name like "a_coyote34"
N "Cleaned up" name like "a coyote"
h Current health %
i SpawnID
x X coordinate
y Y coordinate
z Z coordinate
R Race full name - lower case "r" is reserved for race 3-letter code
C Class full name - lower case "c" is reserved for class 3-letter code
l Level
Note: % - shows a % sign (so if you want your health display to show "100%" you would use %h%%)

/mapshow "spawnname" [reset] (Requires MQ2Map plugin to be loaded)
command to explicitly show spawnname on the map. Only in effect until the mapped spawns are re-generated (same as maphide).

/memspell gem#  "spell name"
Attempts to memorize "spell name" into gem#

Example

/memspell 1 "complete heal" memorizes Complete Heal in spell gem 1

/mouseto
Moves the mouse to specified locations

[+-]x [+-]y Moves the mouse to x y (+|- is relative to the current position)

/mqfont #
Changes the size of the font in the MQ2ChatWnd. The font sizes are not the same as EQ's chat window sizes yet, so be aware of that. You will probably want # to be in the range of -3 to 2.

/mqlog text|clear
Logs text to 'logs'directory or clears the log file. The log file will be saved in the logs folder.

/mqlog The number of combines completed is: ${CombineCount}

/mqpause [on|off]
Pauses/resumes a macro to aid in debugging or chatting. Not using a parameter will toggle pausing on/off

/multiline delimiter command [ delimiter command [ delimiter command [ ...]]]]
Executes all commands

Example

/multiline ; /stand;/rude;/sit
/nomodkey command
Releases all ctrl/alt/shift keys for the duration of the execution of command

/noparse command
Prevents any MQ2Data from being parsed when used in a command.

Example

/noparse /ini blah blah blah ${stuff}

Note: ${stuff} is literal instead of changing it to the current value of stuff.
/notify windowname 0 | controlname [notification [data]]
/notify is used to interact with UI windows directly instead of using the mouse. /notify cannot be used to interact with objects.

Currently notification can be: leftmouse, leftmouseup, leftmousehold, rightmouse, enter, close, newvalue, mouseover,
or history. The use of data will usually not be necessary unless you are notifying a slider control.
Entering "0" for control would send the message to the window itself (used for "close" at least, possibly others). See /windows.

notification can be:

leftmouseup Performs a left click on controlname
leftmouseheld Left click and hold on controlname until leftmouseheldup is performed
leftmouseheldup Releases the mouse from leftmouseheld
rightmouseup Performs a right click on controlname
rightmouseheld Performs a right click and hold on controlname
rightmouseheldup Releases the mouse from rightmouseheld
enter Presses the enter key on controlname
close Clicks the Close Window gadget of windowname
mouseover Hovers the mouse over controlname
newvalue n Changes the value in controlname to n
listselect n Selects the nth item in the controlname list

Examples
/notify hotbuttonwnd HB_Button1 leftmouseup Activates the first hotkey
/notify somewindow SomeSlider newvalue 100 Moves the referenced slider in the window to 100
/notify trackingwnd 0 close Closes the tracking window
/notify TradeskillWnd RecipeList listselect 1 Selects the first item in the RecipeList listbox
/plugin name [unload] | list
Loads, lists, and unloads plugins.

/popup text
Displays text in the center of your screen. Currently the text is fixed font and color.

/popup Current Mana: ${Me.CurrentMana}
/popup Run away! Run away!
/ranged [spawnID]
Performs a ranged attack. Use with no parameters to do a ranged attack on your current target,
or with spawnID to do a ranged attack on that spawn.

/return [value|${varname}]
Returns to the line immediately following the call. Can return values or variables.
Example

Sub MySub
.
<code>
.
/return [value|${varname}]
/sellitem 1|#
Sells the selected item. If # is specified it will sell that # of a stacked item.

/setautorun
Creates an ini entry in Macroquest.ini. Forces character into autorun at login.

/seterror errormsg | clear
Sets macroquest.Error to errormsg

/seterror clear
Clears the last error value
/shift command
Execute a command while telling the window manager that the shift key is pressed. Can also be used together with /alt and/or /ctrl, as in /ctrl /alt /shift command

Example

/shift /itemnotify pack1 leftmouseup
Pick up an entire stack

/skills ["skillname"] (Skills are listed in Appendix C)
Lists your skills, or your skill level
Examples

/skills Lists all of your skills with skill level
/skills pottery Returns your pottery skill
/spew on|off
Enables or disables the output of Debug Spew to a file

/squelch command
Executes a command and prevents any output from the command. This does the following:
1: Turns mq filter off
2: Executes the command
3: Turns mq filter back to the state it was in before step 1

** It is recommended that you do the following in your .CFG files that you dont want to see output from
/squelch /filter mq on
< do your stuff here>
/squelch /filter mq off
/substitute [orig substitution | delete] [list]
Allows you to create custom midline substitutions that will work

Substitutes are called from any alias or commandline by using the percent sign (%)
Examples

   /substitute mom Mother
   /substitute omg Oh my god!
   /substitute k %omg, kill %t before I tell your %mom"

The final example if you typed "/say %k" would produce:

   Oh my god!, kill targetname before I tell your Mother"

Please note the following rules/reminders:
  1. You don't use the percent signs when creating the substitutions or editing your config file.
  2. You can use MQ's subsitutions without spaces around them (unlike EQs!) (ie: /echo %omg%mom" would return "/echo Oh my god!Mother"
  3. Substitutions do not currently work in macros.
  4. /sub is currently a valid shorthand for "/subsitute"
  5. You can use EQ's wildcards (ie: %t) within your substitutions; however, you have to leave spaces around them (yes, they suck)
  6. You cannot CURRENTLY replace EQ wildcards with MQ substitutions (ie, you can't make a replacement for %m (This may be supported in the future.)
/target option

option can be:
pc|npc [corpse] Selects nearest pc or npc. Using corpse will select the nearest pc or npc corpse
corpse Selects the nearest corpse
pet Selects the nearest pet
class class Selects the nearest class match to target
race race Selects nearest race to target
range min max Sets the minimum and maximum level range to target
noalert alert# Target nearest spawn not on alert #
nearalert alert# ***NEED TO FILL THIS DESCRIPTION IN***
notnearalert alert# ***NEED TO FILL THIS DESCRIPTION IN***
zradius zheight Targets the spawn if it is within the height value
radius distance Targets the spawn if it is within the 2D distance
nopcnear radius ***NEED TO FILL THIS DESCRIPTION IN***
notid|id spawnid ***NEED TO FILL THIS DESCRIPTION IN***
spawnname Targets the nearest specified spawnname
myself|mycorpse Targets the yourself or your corpse
alert alert# Targets the specified keyword

/timed deciseconds command
Executes a command after a specified duration (in deciseconds like pause)

Note: This does not "pause" successive commands.

Example

/timed 10 /echo 1 second has passed
/unload
Unloads MacroQuest

/updateitems
Walks through the characters inventory and bank and collects item id's and names.
The item id and name is placed in ItemDB.txt which is created if it does not already exist.

/varcalc varname equation
Calculates the value of equation and stores the result in varname

Example

/varcalc MyVar ${Me.CurrentMana} - ${Spell[Complete Heal].Mana}
/vardata varname new_mq2data_value
Sets a variable directly to the end result of a MQ2Data string.

Example

/vardata MyFloat Math.Calc[${Me.X}+${Me.Y}]
/varset varname value|${varname2}
Sets varname to the specified value. If the variable is a timer, value can be in 10ths of a
second, suffix s for seconds, m for minutes.
Examples
/varset myvar 25 Sets myvar to 25
/varset array[3] 10 Sets the value of array[3] to 10
/varset casttimer 30 Sets the timer to 3 seconds
/varset array[2,12] 45 Sets the value of array[2,12] to 45
/varset casttimer 3m Sets the Timer to 3 minutes
/where [pc|npc|"spawn name"]
Lists where the closest spawn or pc is

Examples
/where Lists the closest pc or npc
/where pc Lists the closest pc
/where npc Lists the closest npc
where npc "orc pawn" Lists where the closest orc pawn is
The message returned is:
The closest 'spawnname' is a level # <race> <class> and <distance> away to the <direction>, Z difference = #.##.

/who option

option can be:
group|pc|npc [invis|merchant|tribute|gm|corpse|any] Lists all matches in the zone for the option used.
Note that tribue is tribute master and gm is Guild Leader
range minlevel maxlevel Lists all matches for the option used that are within the level range designated.
radius # Lists all matches for the option used that are within the radius designated.
guild | noguild Lists all guild members in the zone or pc's in the zone not in a guild
lfg Lists all characters who are looking for a group in the zone
loc intX intY Returns the spawn located that intX intY
name Lists the character with the name name if he/she/it is in the zone
alert # Lists any npc/pc on alert #
noalert # Match all spawns not on list #
knight returns Paladins and Shadowknights in the zone
tank returns paladins, shadowknights, and warriors in the zone
healer returns druids and clerics in the zone
dps returns wizards, rangers, and rogues in the zone
slower returns shamans, enchanters, and beastlords in the zone

/whofilter afk|anon|class |arg|gm|guild |holding|invisible|lastname |level|ld|lfg|npctag |race|spawnid|trader [on |off]
Toggles the display of the specified option when using /who

/whotarget
MacroQuest enhances this command by allowing you to use it on any target (including NPC's) and displays the
target's class, race, level, guild, con color, and distance (even if the player is in anonymous or roleplaying mode).

/windows
List all available UI windows. See /notify command.

/windowstate window [open|close] Opens or closes the selected window.
window can be: inventory, merchant, corpse, spellbook, map, or notes

MacroQuest2 Data Types

MacroQuest2 data types are the means by which properties or methods of objects are accessed and used within macros.

Syntax

The basic syntax for usage is something like this:

    ${TopLevelObject[index].Member[index].Member[index]}

Usage

To access a property with a TLO you begin with the TLO type you want, then append successive type members or properties until you get the result you're looking for.

Note: The use of properties can become very complex, in other words, extremely long, especially when using Math.Calc.

Note: You absolutely MUST pay attention to the return types of each member and object. Make sure when doing comparisons you are comparing a string to a string, or a numeric to a numeric. Using .Equal or .NotEqual to compare .Name to .ID will give errors.

Also be sure to look at the To String of each type.

${Target.Name.Equal[${Me.ID}]} will not work. .Name returns a string, but .ID returns an int

Accessing these properties/methods begins with a Top Level Object(TLO). The TLO is then appended with the property/method desired.

Example of building:

Suppose you want to display the distance to an NPC that you have targeted:

First you start with the TLO spawn Target. spawn indicates that the Target TLO has access to spawn reference type members.

Start with the TLO: Target

Looking at the spawn reference type, you can find a list of the properties and members of spawn

You want to find the distance to the target so you would select one of the Distance members. For this example we will use

float Distance
Distance from player in (x,y)

You then append .Distance to the TLO name: Target.Distance

Once you have gotten to the information you want, you MUST enclose the entire string in ${ }

So the full example would be:

/echo Distance to target is: ${Target.Distance}

which returns the distance to your target in the float format ###.###

All TLO's and reference data types have access to immediate types, but ensure you use the appropriate members of the immediate types with reference types or TLO's.

Example

Using the int immediate type member with a spawn reference type member:

If you wanted to convert the float value Distance to an int value, you could append one of the members of the float immediate type.

${Target.Distance.Int}

MQ2Data Members

Members can also be describd as Properties or things that are property (owned by, contained by, etc) of objects of a type.

For example, the "desk" type of object might have a property called "Screws".

The "Screws" property itself might be represented like this:
int Screw
"int" is a type of object which means WHOLE NUMBER while Screws is the name of the object

To demonstrate an object named Screws that is a member of the "desk" type, we may also say "int desk.Screws"
The return type is of the last member appended.

Inheritance


Inheritance is a way to get less specific about what "type" of object you are looking at. The way this works is you have two types, like "desk" and "woodendesk". All wooden desks are desks, but not all desks are wooden desks. So now we have "woodendesk ThisDesk". Remember that "desk" we said has a member called "Screws" of type "int". "woodendesk" IS a desk, so it automatically gets a member called "Screws". Therefore, "ThisDesk.Screws", even though it is a wooden desk and not just "desk", is valid.

Typecasting

This is a relatively advanced topic. *Please* be aware that you can cause unavoidable crashes by using this. Type casting is causing a type to be directly seen as another type. For example, if you have an int value such as the number of people in your group -- the Group top level object used without an index -- you could cast this as a bool like so: ${Group(bool)}.

Immediate value types can be safely cast as any other immediate value type, or as an Independent type (although that's useless). Independent types can be cast as any other Independent type (although that's useless), or as any immediate value (they will act as though the value is 0).

Immediate-->Immediate
Independent-->Immediate

The problem, and most of the actual usage, lies in casting reference types. You can get the memory address of any reference type by casting it as an int, or you could see if the memory address is non-zero by casting it as a bool. One potential usage of type casting THAT SHOULD NEVER BE USED is to store a memory address to be cast back to a reference type later. The address is NOT guaranteed to be valid when used again!

The syntax for casting is something like this:
${TopLevelObject[index](cast).Member[index](cast).Member[index](cast)}
To change ${Target} from a string to a boolean:
${Target}(bool)
Which could be used in:
${If[${Target}(bool),true,false]}
All Boolean use must use a numeric property. ${If[${Target.Name},true,false]} will fail.

Example

/varset myvar ${Spawn[1](int)}
/echo ${Int[${myvar}](spawn).Name}

Do NOT do that! It will only work until the memory address changes. Instead, use the ID as you always have:

/varset myvar ${Spawn[1].ID} /echo ${Spawn[${myvar}].Name}
However, the part that will come in handy is for people to extend these types by using their own types in a plugin. If you wanted, you could have your plugin make a type called "mytype" that accesses a spawn. Maybe a member of mytype is called "IsCloseToMe" and is a bool value. This would let you do: ${Spawn[1](mytype).IsCloseToMe}.

Important Note: Special handling is used for casting to "type", such that the new data is equal to the old type, and the new type is "type".

Top Level Objects

A "Top Level Object" is any kind of object that you can start with when trying to find a property.

  1. The TLO type is indicated by the italic text preceding the name
  2. The TLO has access to the type members
  3. The TLO name is static and it cannot be changed
TLO's are called Top Level Objects because nothing comes before them. A TLO is not a member of any object. It is itself an object. However, the TLO has access to all members and properties of its type, and any inherited members of it's type.

The immediate type named int and the Top Level Object named Int are not the same thing. The TLO is an object only, not a type.

The type members that the TLO has access to is shown in italics.

Example

character Me is a Top Level Object of type character, but Me is not the character type. Me has access to the members of the character type

TLO List

AltAbility
altability AltAbility[n] Alt ability by number
altability AltAbility[name] Alt ability by name

access to types: altability

Examples

/echo ${AltAbility[Combat Stability].RequiresAbility}}
Returns the pre-requisite AA ability needed to train in this Ability

/echo ${AltAbility[n].RequiresAbility}}
Returns the pre-requisite AA ability needed to train in the Ability with the number n
Bool
bool Bool[text]

access to type(s): bool

Creates a bool object using text. Value is set to TRUE unless text is "NULL" "FALSE" or "0" (capitalization does not count)

Examples

/declare MyVar bool

/varset MyVar ${Bool[This is true]}
/echo ${MyVar} would echo TRUE

/varset MyVar ${Bool[NULL]}
/echo ${MyVar} would echo FALSE

Me

character Me

access to types: character, spawn

character object which allows you to get properties of you as a character

${Me} is a character object, so has access to all of the properties of the character reference Type. The character Type also has access to the properties of the spawn Type.

To get information on your character, you would use the TLO Me and append the particular property name you are interested in, for example:
int CurrentHPs Current hit points
The italicized text preceding the member name indicates the return type, in this case an integer. The property name follows the return type.

So to display your characters current hit points, you would use
Example

/echo ${Me.CurrentHPs}
If you look at the members and properties of the character referenceType, you will notice that there is no Speed property, but since character has access to the properties of the spawn reference Type, you can find your character's speed by using ${Me.Speed}

Corpse
corpse Corpse

access to type(s): corpse

Object of type corpse which is the currently active corpse (the one you are looting)
Example

/if ${Corpse.Open} {
Do this stuff
}

If the loot window is open Do this stuff
Cursor
item Cursor

access to type(s): item

Creates an object which references the item on your cursor
Example

/if (${Cursor.ID} ) /autoinv
If something is on your cursor, drop it into the autoinventory
Defined
bool Defined[name]

access to type(s): bool

Determines whether a variable, array, or timer with this name exists

Example

/if (${Defined[varname]}) { Do this stuff }

If the variable has been declared execute Do this stuff
Ground
ground Ground

access to type(s): ground

Object which references the ground spawn item you have targeted
Example

/echo ${Ground.Distance}
Echos the distance to the ground item you have targeted
FindItem
item FindItem[ [=]name]

access to type(s): item

Object which is the found item on your character, a corpse, or a merchant by partial name match. Using =name will only find exact match
Examples

/itemnotify ${FindItem[sprinkler].InvSlot} leftmouseup
Picks up your cleric epic from your corpse

/itemnotify ${FindItem[swirling].InvSlot} leftmouseup
Picks up any item containing the word swirling from the opened corpse
FindItemBank
item FindItemBank[ [=]name]

access to type(s): item

Find item in bank by partial name match. =name will find exact match only
Example

/echo ${FindItem[=Swirling Shadows]}
This is a simple example with little use, but If the item is found, the name of the item will be echoed
FindItemBankCount
int FindItemBankCount[ [=]name]

access to type(s): int

Count of items in bank by partial name match. =name will find exact match only
Example

/echo ${FindItemBankCount[Swirling]}
Returns how many Swirling Shadows you have in your bank
FindItemCount
int FindItemCount[ [=]name]

access to type(s): int

Count of items on character by partial name match. =name will find exact match only
Example

/echo ${FindItem[=Water Flask]}
Echoes the number of Water Flask you have in your inventory
Float
float Float[n]

access to type(s): float

Creates a float object from n
Example

${Float[12.345].Deci}
Creates a float object of 12.345 and truncates the decimal to one decimal place
GameTime
time GameTime

access to type(s): time

Makes a time object called GameTime
Example

/echo ${GameTime.Date}
Echos todays real time date to the chat window
Group
int Group Gets the number of players in your group
spawn Group[n] Finds the nth group member

access to type(s): int or spawn respectively

${Group[0]} is the same as ${Me}

Examples

/echo Group member ${n}'s direction is: ${Group[${n}].HeadingTo}

/echo My group has ${Group} members
GroupLeader
spawn GroupLeader

access to type(s): spawn

Group leader (only works if they are in zone)
Example

/echo Group Leaders name is: ${GroupLeader.Name}
Echos your group leaders name
GroupLeaderName
string GroupLeaderName

access to type(s): string

Group leader's name (works even if they are out of zone)
Example

/if (${GroupLeaderName.Find[zerix]} {
.
Insert appropriate code to mock the groupleader here
.
}

If you know the name Zerix, you will understand.
Heading
heading Heading[degrees] Creates a heading object using degrees (clockwise)
heading Heading[y,x] Creates a heading object using the heading to this y,x location.
heading Heading[N,W] Same as above, just an alternate method

access to type(s): heading

Object that refers to the heading to of something or a location

Examples

/echo ${Heading[15].ShortName}
Echos the shortname of the heading of 15 degrees.

/echo ${Heading[-342,700].ShortName}
Echos the shortname heading to the location -342,700
If
string If[conditions,whentrue,whenfalse]

access to type(s): string

Performs Math.Calculate on conditions, gives whentrue if non-zero, gives whenfalse if zero
Examples

/docommand ${If[${Me.Sitting},/stand,/echo I am not sitting down]}
If I am sitting, stand up, Otherwise echo I am not sitting down

/docommand ${If[${Me.CurrentHP}<50,/cast "Gate",/goto :Continue]}
If my hp percent is below 50 cast the Gate spell, otherwise goto the Continue label
Ini
string Ini[filename,section,key,default]

access to type(s): string

Reads value(s) from an ini file located in a relative or absolute path
  1. The section, key, and default do not need to be given
  2. section and key may be set to -1 to skip them and give a new value.
  3. If section or key are not given, multiple values are read.
Example

sample.ini contains:

[KeyOne]
value1=foo
value2=bar

[KeyTwo]
Value3=foobar

${Ini[sample.ini,KeyOne,value1]} returns foo
${Ini[sample.ini,KeyOne] returns value1|value2||
${Ini[sample.ini] returns KeyOne|KeyTwo||
Int
int Int[n] Make an int object using n

access to type(s): int

Object that creates an integer from n

Example

/echo ${Int[123].Hex}
echos the result of the conversion of 123 to an int in hexadecimal
InvSlot
invslot InvSlot[name] Inventory slot by name
invslot InvSlot[#] Inventory slot by number

access to type(s): invslot

See Appendix E: Slot Names for slot names and numbers
Examples

/if (!${Window[pack${bag}].Open}) /itemnotify pack${bag} rightmouseup
If the container in slot pack${bag} isn't opened, open it

/if (${InvSlot[bank${index}].Item.Container}) /call CheckPack bank${index}
Is the item in bank${index} a container, if so /call CheckPack and pass the parameter bank${index}
LastSpawn
spawn LastSpawn[n] The nth latest spawn (chronological order)
spawn LastSpawn[-n] The nth oldest spawn (chronological order)

access to type(s): spawn

Note: When you enter a zone you dont know the spawn order of anything already there, just anything that spawns later.

The useful thing about ${LastSpawn[-1]} is just being able to get the first spawn in the list which you might use in conjunction with other spawn members to go through the entire spawn list in a loop.

Examples

/echo ${LastSpawn[10].ID}
Echos the spawnID of the 10th mob to spawn in the zone

/echo ${LastSpawn[-10]}
Echos the name of the 10th to last spawn in the zone
LineOfSight
bool LineOfSight[y,x,z:y,x,z]

access to type(s): bool

Example

/echo ${LineOfSight[20,40,-20:100,-300,70}
Returns TRUE if Line of Sight is clear between the two locations
Macro
macro Macro

access to type(s): macro

Creates an object related to the macro that is currently running
Example

/echo This macro has been running for: ${Macro.RunTime.Second} seconds
MacroQuest
macroquest MacroQuest: MacroQuest

Creates an object related to MacroQuest information

access to type(s): macroquest

Example

/echo ${MacroQuest.LastTell}
Returns the name of the last person to send you a tell
Math
math Math

access to type(s): math

Creates a Math object which gives allows access to the math type members.
Example

/echo ${Math.Sqrt[49]}
Echos the square root of 49

/echo ${Math.Rand[500]}
Echos a random number between 0 and 500

/echo ${Math.Calc[49%6+25]}
Echos the result of 49%6+25, or 1+25
Merchant
merchant Merchant Currently active merchant

access to type(s): merchant

Object that interacts with the currently active merchant
Example

/echo ${Merchant.Name}
Echos the name of the merchant whos window you have open
NamingSpawn
spawn NamingSpawn

access to type(s): spawn

Spawn currently being captioned. NULL when not captioning.

Add custom spawn captioning through the additions to the [Captions] section in Macroquest.ini

Empty the setting to make it use EQ's default.

By default our player caption is slightly different - it shows their guild status if they are officer or leader of a guild.

Pet captions are a little different also - it will display the name of its master if it is a player's pet.

Use "\n" to mean a new line when setting captions.

There are 4 categories of captions for Players

The ini options are:
Player1= what is displayed using /shownames 1
Player2= what is displayed using /shownames 2
Player3= what is displayed when using /shownames 3
Player4 = what is displayed when using /shownames 4
Look in the [Captions] section of the Macroquest.ini file included in the zip file for examples

NearestSpawn
spawn NearestSpawn[n] The nth nearest spawn
spawn NearestSpawn[search] The nearest spawn matching this search (same as Spawn[search])
spawn NearestSpawn[n,search] The nth nearest spawn matching this search

access to type(s): spawn

Object that is used in finding spawns nearest to you

Examples

/echo ${NearestSpawn[npc range 100 "orc pawn"]}
Finds any npc containing orc pawn in its name that is within 100 of you

/echo ${NearestSpawn[1]}
Finds the closest spawn to you
Plugin
plugin Plugin[name] Finds plugin by name
plugin Plugin[n] Plugin by number, starting with 1 and stopping whenever the list runs out of plugins.

access to type(s): plugin

Object that has access to members that provide information on a plugin

Raid
raid Raid Current raid

access to type(s): raid

Object that has access to members that provide information on your raid

Example

/echo ${Raid.Members}
Echos the number of members in your raid
SelectedItem
item SelectedItem When using a merchant, etc. this is the selected item

access to type(s): item

Object used to get information on your currently selected item in a pack or in inventory
Examples

/if (${SelectedItem.Charges}<1)
Determines if the selected item is out of charges

/if (${SelectedItem.Name.Equal[rusty dagger]})
Checks to see if the selected item is a rusty dagger
Skill
skill Skill[n] Skill by number
skill Skill[name] Skill by name

access to type(s): skill

Object used to get information on your character skills
Examples

/echo ${Skill[1].ReuseTime}
Displays the reuse time of skill 1

/echo ${Skill[backstab]].ID}
Displays the skill number of the backstab skill
Spawn
spawn Spawn[ID] Find spawn by ID
spawn Spawn[search string] Find spawn by spawn search string

access to type(s): spawn

Object used to get information on a specific spawn. Uses the same filters as those from /target, /who
Examples

/echo ${Spawn[n]}
Displays the name of the spawn with id number n

/target ${Spawn[npc radius 500 trakanon]}
Targets the npc with the name Trakanon only if within a radius of 500
SpawnCount
int SpawnCount Total number of spawns in current zone
int SpawnCount[search] Total number of spawns in current zone matching the search

access to type(s): int

Object used to get information on the count(s) of all spawns or specific spawn(s).
Examples

/echo ${SpawnCount}
Displays the count of all spawns

/echo ${SpawnCount[range 45 50}
Displays the count of all spawns in the level range of 45 to 50
Spell
spell Spell[n] Find spell by ID
spell Spell[name] Find spell by name

access to type(s): spell

Object used to return information on a spell by name or by ID

Examples

/echo ${Spell[n].MyCastTime}
Returns your adjusted cast time for spell with id n

/echo ${Spell[spellname].PushBack}
Returns the pushback amount of spellname
String
string String[text] Make a string object using text

access to type(s): string

Object that is used in the conversion of types to the string type
Examples

/echo ${String[MacroQuest].Right[5]}
Echos the word: Quest

/echo ${String[This is my sentence].Arg[4]}
Echos the word: sentence

Note: Be aware of how the use of quotes affect the text
${String["hi"]} Result: hi
${String["hi","hi"]} Result: hi,hi
${String[""hi""]} Result: "hi"
${String[hi"hi"hi]} Result: hi"hi"hi
${String[[MQ2] - Hi]} Result: [MQ2] - Hi
${String["""]} Result: "
Switch
switch Switch Your target, if you have a switch (door, etc) targeted

access to type(s): switch

Object used when you want to find information on targetted doors or switches such as the portals in PoK.
Examples

/echo ${Switch.Heading}
Returns the direction to the switch

/echo ${Switch.Open}
Returns TRUE or FALSE
Target
spawn Target Your target

access to type(s): spawn

Object used to get information about your target.
Examples

/echo ${Target.Level}
Echos the level of your target(if it has one)

/echo ${Target.Name.Equal[iron oxide]}
Echoes a boolean value of whether your item targetted is Iron Oxide
Time
time Time Your local time in real life

access to type(s): time

Object used to return information on real time, not game time
Example

/echo ${Time.DayOfWeek}
Returns the day of the week
Type
type Type[name] Finds an MQ2 Data type by name

access to type(s): type

Object used to check the type of a variable
Examples

/if ${Type[MyParam].Name.NotEqual[bool]} {
/echo This variable is not of type bool
}

${Type[spawn].Member[ID]}
Determines if a member of a type exists

${Type[spawn].Member[${n}]}
Enumerate members of a type using a loop
Window
window Window[name] Find window by name

access to type(s): window

Used to find information on a particular UI window

You can display a list of window names using the /windows command
Examples

/echo ${Window[MerchantWnd].Open}
Returns TRUE if a Merchant window is open

/echo ${Window[windowname]}
Returns TRUE if the WindowName exists, but doesn't have to be opened.

/echo ${Window[MerchantWnd].Minimized}
Returns TRUE if the Window is opened and minimized

${Window[TradeskillWnd].Child[RecipeList].List[=Inky Shadow Silk]}
Find an item in the tradeskill item list box by the exact name Inky Shadow Silk

${Window[TradeskillWnd].Child[RecipeList].List[1]}
Get the first-column text for the 1st item in the tradeskill item list box
Zone
currentzone Zone Current zone
zone Zone[name] Find zone by short name
zone Zone[n] Find zone by ID

access to type(s): currentzone and zone respectively

Object used to access information on a zone

Examples

/echo ${Zone.Type}
Returns an integer representing the zone you are in

/echo ${Zone[zonename].ID}
Returns the ID of zonename, even if you aren't in the zone

/echo ${Zone[zoneid].ShortName}
Returns the short name of the zone with ID zoneid
Reference Types

altability

Members
int AARankRequired Rank required to train
int Cost Base cost to train
string Description Basic description
int ID ID number
int MaxRank Max rank available in this ability
int MinLevel Minimum level to train
string Name Name of the alt ability
altability RequiresAbility Required ability (if any)
int RequiresAbilityPoints Points required in above ability
int ReuseTime Reuse time in seconds
string ShortName Short name
spell Spell Spell used by the ability (if any)
int Type Type (1-6, this may change to string eventually)
To String Same as Name

array

Members
int Dimensions Number of dimensions this array stores
int Size Total number of elements this array stores
int Size[n] Total number of elements stored in the nth dimension of this array
To String None

buff (inherits spell)

Members
int ID Gives the song # or buff # not the spell's ID
int Level Level
spell Spell Spell
float Mod Bard song modifier
ticks Duration Duration
To String Same as spell.Name

character (inherits spawn)

Members
int AvoidanceBonus Avoidance bonus from gear/spells
int AccuracyBonus Accuracy bonus from gear/spells
int StunResistBonus Stun Resist bonus from gear/spells
int StrikeThroughBonus Strikethrough bonus from gear/spells
int DoTShieldBonus DoT Shield bonus from gear/spells
int AttackBonus Attack bonus from gear/spells
int HPRegenBonus HP regen bonus from gear/spells
int ManaRegenBonus Mana regen bonus from gear/spells
int DamageShieldBonus Damage Shield bonus from gear/spells
int AttackSpeed Your Attack Speed %
int LanguageSkill[languagename] Your skill in the selected language
int ID Spawn ID
string Name First name
int Level Level
int Exp Experience (of 330)
float PctExp Experience as a %
spawn Spawn The character's spawn
int AAExp AA exp
float PctAAExp AA exp as a %
int AAPoints Unused AA points
int CurrentHPs Current hit points
int CombatEffectsBonus Combat Effects bonus from gear/spells
int EnduranceBonus Endurance bonus from gear/spells
int MaxHPs Max hit points
int HPRegen Hit point regeneration
int PctHPs Percent hit points
int CurrentMana Current mana
int MaxMana Max mana
int ManaRegen Mana regeneration
int PctMana Percent mana
int Endurance Current endurance
int MaxEndurance Max endurance
int PctEndurance Percent endurance
buff Buff[slot] The buff in this slot (1-15)
buff Buff[name] Finds buff with this name
int ShieldingBonus Shielding bonus from gear/spells
buff Song[slot] The song in this slot (1-6)
buff Song[name] Finds song with this name
int SpellShieldBonus Spell Shield bonus from gear/spells
string Surname Last name
bool Grouped Grouped?
int HPBonus Hit point bonus from gear/spells
int ManaBonus Mana bonus from gear/spells
int GukEarned Total ldon points earned in guk
int MMEarned Total ldon points earned in mm
int RujEarned Total ldon points earned in ruj
int TakEarned Total ldon points earned in tak
int MirEarned Total ldon points earned in mir
int LDoNPoints Available ldon points
int CurrentFavor Current favor
int CareerFavor Career favor
item Inventory[slot] Item in this slot (1-29)
item Inventory[slotname] Item in this slot (inventory slots only, but same names as /itemnotify)
item Bank[slot] Item in this slot (1-18)
zone Bound The zone you are bound in
bool Combat In combat?
bool Grouped Grouped?
spell Gem[slot] The spell in this slot #
int Gem[name] The slot # with this spell name
int Dar Damage absorption remaining
bool Moving Moving? (including strafe)
int Hunger Hunger level
int Thirst Thirst level
spell Book[slot] Spell assigned to this slot in your spellbook
int Book[name] Spell slot the spell with this name is assigned to in your spellbook
int Skill[name] Skill level of skill with this name
int Skill[n] Skill level of skill with this ID
string Ability[slot] Skill name assigned to this doability button
int Ability[name] Doability button number this skill name is on
bool AbilityReady[name] Ability with this name ready?
bool AbilityReady[slot] Ability on this button ready?
bool SpellReady[name] Gem with this spell name ready for cast?
bool SpellReady[slot] Spell in this gem ready for cast?
int PetBuff[name] Finds slot with this spell name
spell PetBuff[n] The spell in this slot (1-29)
int GroupLeaderExp Group leadership exp
float PctGroupLeader ExpGroup leadership exp as a %
int GroupLeaderPoints Group leadership points
int RaidLeaderExp Raid leadership exp
float PctRaidLeaderExp Raid leadership exp as a %
int RaidLeaderPoints Raid leadership points
int Platinum Platinum
int Gold Gold
int Silver Silver
int Copper Copper
int PlatinumBank Platinum in bank
int GoldBank Gold in bank
int SilverBank Silver in bank
int CopperBank Copper in bank
int Cash Cash in copper
int CashBank Banked cash in copper
int PlatinumShared Shared-banked platinum
bool Stunned Stunned?
bool RangedReady Ranged attack ready?
bool AltTimerReady Alternate timer ready? (Bash/Slam/Frenzy/Backstab. Note that AbilityReady works fine with most of these)
int AltAbility[n] Alt ability rank by number
int AltAbility[name] Alt ability rank by name
bool AltAbilityReady[n] Alt ability readiness by number
bool AltAbilityReady[name] Alt ability readiness by name
int AltAbilityTimer[n] Alt ability reuse time (seconds) left by number
int AltAbilityTimer[name] Alt ability reuse time (seconds) left by name
spell CombatAbility[n] Combat ability by number in your list (not same as others lists!)
int CombatAbility[name] Combat ability number in your list by name (not same as others lists!)
int FreeInventory Count of free inventory spaces
int FreeInventory[n] Count of free inventory spaces of at least n size (giant=4)
int LargestFreeInventory Size of largest free inventory space
spawn RaidAssistTarget[n] Current raid assist target (1-3)
spawn GroupAssistTarget Current group assist target
spawn RaidMarkNPC[n] Current raid marked NPC (1-3)
spawn GroupMarkNPC[n] Current group marked NPC (1-3)
spawn TargetOfTarget Target of target (moved to character type)
ticks AltAbilityTimer[n] Alt ability reuse time left, by number
ticks AltAbilityTimer[name] Alt ability reuse time left, by name
string GroupList Returns a string of your group members (excluding you)
bool AmIGroupLeader Group Leader?
To String Same as Name

ground

Members
int ID Ground item ID (not the same as item ID, this is like spawn ID)
float Distance Distance from player to ground item in (x,y)
float X X coordinate
float Y Y coordinate
float Z Z coordinate
float W X (Westward-positive)
float N Y (Northward-positive)
float U Z (Upward-positive)
heading Heading Ground item is facing this heading
heading HeadingTo Direction player must move to meet this ground item
bool LineOfSight Returns if ground spawn is in Line of Sight
string Name Name
To String Same as ID

item

Members
int ID Item ID
string Name Name
bool Lore Lore?
bool NoDrop No drop?
bool NoRent No rent?
bool Magic Magic?
int Value Item value in copper
int Size Item size
int Weight Item weight
int Stack Stack count
string Type Type
int Tribute Tribute value of the item
int Charges Charges
string LDoNTheme "Non-LDON" "Deepest Guk" "Miragul's" "Mistmoore" "Rujarkian" "Takish"
string DMGBonus Type None Magic Fire Cold Poison Disease
bool Stackable Stackable?
int Container Number of slots, if this is a container
int Items Number of items, if this is a container
item Item[n] nth contained item, if this is a container
int BuyPrice Price to buy this item at this merchant
int SellPrice Price to sell this item at this merchant
int WornSlots The number of invslots this item can be worn in (fingers/ears count as 2 slots)
invslot WornSlot[n] The nth invslot this item can be worn in (fingers/ears count as 2 slots)
bool WornSlot[name] Can item be worn in invslot with this name? (worn slots only..)
spell Spell Spell effect
float CastTime Spell effect's cast time
string EffectType Spell effect type
To String Same as Name

plugin

Members
string Name Name of the plugin, for example "MQ2ChatWnd"
To String Same as Name

skill

Members
string Name Name of the skll
int ID Skill number
float Accuracy Base accuracy of the skll
int ReuseTime Reuse timer (dont know yet if it's in 10ths of seconds or what)
bool AltTimer Skill uses the kick/bash/slam/backstab/frenzy timer?
int MinLevel Minimum level for your class
int StartingSkill Base skill level for your class
int SkillCapPre50 Skill cap pre-50 for your class
int SkillCapPost50 Skill cap post-50 for your class
To String Same as Name

spawn

Members
int AARank AA rank number
string AATitle Actual AA title (e.g. Sage, Impresario, etc)
bool AFK AFK?
int Animation Current animation id
bool Anonymous Anonymous?
bool Assist Current Raid or Group assist target?
bool Binding Binding wounds?
body Body Body type
spell Casting Spell, if currently casting
class Class Class
string CleanName The "cleaned up" name
string ConColor GREEN, LIGHT BLUE, BLUE, WHITE, YELLOW, RED
int CurrentHPs Current hit points
deity Deity Deity
float DistanceX Distance from player in X plane
float DistanceY Distance from player in Y plane
float DistanceZ Distance from player in Z plane
float Distance Distance from player in (x,y)
float Distance3D Distance from player in (x,y,z)
float DistancePredict Estimated distance in (x,y), taking into account the spawn's movement speed but not the player's
float DistanceW Distance from player in X plane (East/West)
float DistanceN Distance from player in Y plane (North/South)
float DistanceU Distance from player in Z plane (Up/Down)
bool Ducking Ducking?
bool FeetWet Feet wet/swimming?
bool Feigning Feigning?
string Gender Gender
bool GM GM?
bool GroupLeader Current Raid or Group marked npc mark number (raid first)
string Guild Guild name
string GuildStatus Guild status (Leader, Officer, Member)
heading Heading Heading in this direction
heading HeadingTo Heading player must travel in to reach this spawn
heading HeadingToLoc[y,x] Heading to the coordinates y,x from the spawn
float Height Height
int Holding Represents what the pc/npc is holding
int Hunger Hunger level
int ID SpawnID
string Name Name
int Level Level
float X X coordinate
float Y Y coordinate
float Z Z coordinate
float N Y, the Northward-positive coordinate
float W X, the Westward-positive coordinate
float U Z, the Upward-positive coordinate
float S Shortcut for -Y (makes Southward positive)
float E Shortcut for -X (makes Eastward positive)
float D Shortcut for -Z (makes Downward positive)
bool LineOfSight Returns TRUE if spawn is in LoS
spawn Next Next spawn in the list
spawn Prev Previous spawn in the list
float Speed Speed
bool Levitating Levitating?
bool Sneaking Sneaking?
string Light Name of the light class this spawn has
string State STAND SIT DUCK BIND FEIGN DEAD STUN UNKNOWN
int MaxHPs Maximum hit points
int PctHPs Percent hit points
string Type PC NPC Untargetable Mount Pet Corpse Chest Trigger Trap Timer Item
string Surname Last name
spawn Master Master, if it is charmed or a pet
spawn Pet Pet
spawn Mount Mount
race Race Race
float MaxRange The Max distance from this spawn for it to hit you
float MaxRangeTo The Max distance from this spawn for you to hit it
bool Swimming Swimming?
bool Underwater Underwater?
bool Roleplaying Roleplaying?
float Look Looking this angle
bool Invis Invisible? (also includes both successful and failed hides as well as shroud of stealth)
bool LFG LFG?
bool Linkdead Linkdead?
bool Trader Trader?
bool Sitting Sitting?
bool Standing Standing?
bool Invited Invited to group?
spawn NearestSpawn[search] Find the nearest spawn matching this search, to this spawn (most efficient on yourself)
spawn NearestSpawn[n,search] Find the nth nearest spawn matching this search, to this spawn (most efficient on yourself)
int Mark Current Raid or Group marked npc mark number (raid first)
int Thirst Thirst level
To String Same as Name

spell

Members
int ID Spell ID
string Name Name
int Level Level
string Skill Skill name
int Mana Mana cost (unadjusted)
int ResistAdj Resist adjustment
float Range Maximum range to target
float AERange AE range
float PushBack Push back amount
float CastTime Cast time (unadjusted)
float FizzleTime Time to recover after fizzle
float RecoveryTime Same as FizzleTime
float MyCastTime Adjusted cast time
float RecastTime Time to recast after successful cast
ticks Duration Duration of the spell if any
string SpellType Beneficial(Group) Beneficial Detrimental Unknown
string TargetType Group v2 AE PC v2 etc
string ResistType Chromatic Disease Poison Cold Fire Magic Unresistable Unknown
To String Same as Name

string

Members
int Find[text] Looks for the given text, gives position (currently NULL if not found)
int Length The length of the string
string Upper The string in all UPPER CASE
string Lower The string in all lower case
string Left[length] The left (length) of the string.. Left[2] of "Left" will be "Le"
string Right[length] The right (length) of the string.. Right[2] of "Left" will be "ft"
string Mid[position,length] The left (length) starting at (position).. Mid[2,3] of "Left" will be "ef"
int Compare[text] -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case does not count.
int CompareCS[text] -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case counts.
bool Equal[text] Strings equal? Case does not count
bool NotEqual[text] Strings not equal? Case does not count
bool EqualCS[text] Strings equal? Case counts!
bool NotEqualCS[text] Strings not equal? Case counts!
string Arg[n,separator] Gets nth argument using separator as the separator (single character). separator defaults to space
string Token[n,separator] Retrieve a token from the string using a custom separator. Will not skip empty values
int Count[char] Count the number of occurrences of a particular character in the string
string Left[-length] The left ("all but" length) of the string.. Left[-1] of "Left" will be "Lef"
string Right[-length] The right ("all but" length) of the string.. Right[-1] of "Left" will be "eft"
To String this IS a string, assface

Example

Sub Main
/declare MyVar string local
/varset MyVar "THIS,,IS,A,,TEST"
/echo Using Arg: ${MyVar.Arg[2,,]}
/echo Using Token: ${MyVar.Token[2,,]}
/return

The output from the above would be:

Using Arg: IS
Using Token: NULL
switch

Members
int ID Switch ID
float Distance Distance from player to switch in (x,y)
float X X
float Y Y
float Z Z
float W X (Westward-positive)
float N Y (Northward-positive)
float U Z (Upward-positive)
heading Heading Switch is facing this heading
bool LineOfSight Returns TRUE if the switch is in LoS
float DefaultX "closed" state X
float DefaultY "closed" state Y
float DefaultZ "closed" state Z
float DefaultW "closed" state X (Westward-positive)
float DefaultN "closed" state Y (Northward-positive)
float DefaultU "closed" state Z (Upward-positive)
heading DefaultHeading "closed" state heading
bool Open Open?
heading HeadingTo Direction player must move to meet this switch
string Name Name
To String Same as ID

time

Members
int Hour Hour (0-23)
int Minute Minute
int Second Second
int DayOfWeek 1=sunday to 7=saturday (might make a data type later)
int Day Day of the month
int Month Month of the year
int Year Year
string Time12 hhmmss, 12-hour format
string Time24 hhmmss, 24-hour format
string Date MM/DD/YYYY
bool Night Gives true if the current hour is considered "night" in EQ (700pm-659am)
To String Same as Time24


timer

Members
int Value Current value of the timer
int OriginalValue Original value of the timer
To String Same as Value

type

Members
string Name Type name
string Member[id] Member name based on an internal ID number (based on 1 through n, not all values will be used)
int Member[name] Member internal ID number based on name (will be a number from 1 to n)
To String Same as Name

window

Members
bool Open TRUE if the window is open
window Child[name] Child with this name
int VScrollMax Vertical scrollbar range
int VScrollPos Vertical scrollbar position
int VScrollPct Vertical scrollbar position in % to range from 0
int HScrollMax Horizontal scrollbar range
int HScrollPos Horizontal scrollbar position
int HScrollPct Horizontal scrollbar position in % to range from 0
bool Children Has children?
bool Siblings Has siblings?
window Parent Parent window
window FirstChild First child window
window Next Next sibling window
bool Minimized Minimized?
int X Screen X position
int Y Screen Y position
int Height Height in pixels
int Width Width in pixels
bool MouseOver Mouse currently over?
argb BGColor Background color
string Text Window's text
string Tooltip TooltipReference text
int Style Window style code
bool Enabled Enabled?
bool Highlighted Highlighted/mouse over?
bool Checked Checked? (useful for buttons)
string List[n] Get the first-column text for the nth item in a list box. Only works on list boxes.
int List[text] Find an item in a list box by partial match (use window.List[=text] for exact). Only works on list boxes.
string Name Name of window piece (e.g. "ChatWindow" for top level windows, or the Piece name (NOTE: CUSTOM UI DEPENDANT) for child windows)
string ScreenID ScreenID of window piece (ScreenID is NOT custom ui dependant, this *must be* the same on ALL UIs)
string Type Type of window piece (Screen for top level windows, or Listbox, Button, Gauge, Label, Editbox, Slider, etc)
To String TRUE if exists, FALSE if not

zone

Members
int ID Zone ID
string Name Full name like "Ocean of Tears"
string ShortName Short name like "oot"
To String Same as Name

Immediate Types

argb

Members
int A Alpha
int R Red
int G Green
int B Blue
int Int The integer formed by ARGB
To String The hex value of the integer formed by ARGB

bool

Members
To String "TRUE" for non-zero, or "FALSE" for zero

body

Members
int ID The body type's ID #
string Name The full body type name
To String Same as Name

byte

Members
To String The number

class

Members
bool CanCast Can usually cast? (not melee only)
bool ClericType Cleric/Paladin?
bool DruidType Druid/Ranger?
int ID The class's ID #
string Name The "long name" as in "Ranger"
bool NecromancerType Necromancer/Shadowknight?
bool PetClass Pet class? (shaman, necromancer, mage, beastlord)
bool PureCaster Pure caster? (can gate!)
bool ShamanType Shaman/Beastlord?
string ShortName The "short name" as in "RNG"
To String Same as Name

corpse

Members
int Items Item count on the corpse
item Item[n] nth item on the corpse
item Item[name] Finds an item by partial name in this corpse (use Item[=name] for exact)
bool Open Corpse open?
To String FALSE, except if a corpse is open gives TRUE

deity

Members
int ID The deity's ID #
string Name The full deity name
string Team The team name
To String Same as Name

float

Members
string Deci ###.#
string Centi ###.##
string Milli ###.###
int Int The whole number portion (will not round)
string Precision[n] Convert to a string with this number of digits after the decimal (1 is Deci, 2 is Centi, etc)
To String ###.##

heading

Members
int Clock The nearest clock direction, e.g. 1-12
float Degrees Heading in degrees (same as casting to float)
float DegreesCCW Heading in degrees Counter-Clockwise (the way the rest of MQ2 and EQ uses it, and is expected by older macros)
string Name "south" "south by southeast" etc
string ShortName "S" "SSE" etc
To String Same as ShortName

int

Members
float Float The number as a float (instead of 123, this will give 123.0)
string Hex The hex value of the integer
int Reverse Endianness reversed
To String The number

invslot

Members
int ID Number of this item slot (usable directly by /itemnotify)
item Item Item contained by this item slot
invslot Pack Container that must be opened to access the slot with /itemnotify
int Slot Slot number inside the pack which holds the item
string Name For inventory slots not inside packs, the slot name
To String Same as ID

ticks

Members
int Hours The number of hours in hh:mm:ss
int Minutes The number of minutes in hh:mm:ss (will never be 60+)
int Seconds The number of seconds in hh:mm:ss (will never be 60+)
string Time The time formatted as mm:ss
int TotalMinutes The total number of minutes
int TotalSeconds The total number of seconds
int Ticks The value in ticks
string Time Time in the form mm:ss (if there are no hours, the form will be mm:ss)
string TimeHMS Time in the form hh:mm:ss (if there are no hours, the form will be mm:ss)
To String Same as Ticks

race

Members
int ID The race's ID #
string Name The full race name
To String Same as Name

raidmember (inherits "spawn" when they are in zone)

Members
class Class Raid member's class (works without being in zone)
int Group Current group number (or 0)
bool GroupLeader Group leader?
int Level Raid member's level (works without being in zone)
bool Looter Allowed to loot with current loot rules and looters?
string Name Player's name
bool RaidLeader Raid leader?
spawn Spawn spawn object for this player if available (must be in zone)
To String Same as Name

Independent Types

currentzone (Inherits zone)

Members
float Gravity Gravity
int ID Zone ID
float MinClip Minimum clip plane allowed in this zone
float MaxClip Maximum clip plane allowed in this zone
string Name Full name like "Ocean of Tears"
string ShortName Short name like "oot"
int SkyType Sky type
int Type Zone type
To String Same as Name

macro

Members
string Name Name of current macro
int Params Number of parameters to current sub
string Return Last value from /return
int RunTime Amount of time macro has been running
To String Same as Name

macroquest

Members
string Error Last normal error message
string GameState CHARSELECT INGAME UNKNOWN
string LastCommand Last command entered
string LastTell Name of last person to send you a tell
string LoginName Your station name
int MouseX Mouse's x location
int MouseY Mouse's y location
string MQ2DataError Last MQ2Data parsing error message
int Running Running time of current MQ2 session, in milliseconds
string Server Full name of your server
string SyntaxError Last syntax error message
To String None

math (See Appendix A for valid Operators)

Members
float Abs[formula] Absolute value (calculates first)
float Acos[n] The Acos of n
float Asin[n] The Asin of n
float Atan[n] The Atan of n
float Calc[formula] Performs one mathematical calculation ^ \ % + / - * != < <= == >= > && & || |
float Cos[n] The Cos of n
int Dec[hex] The decimal value given a hexadecimal string
float Distance[y,x,z:y,x,z] Performs distance calculations in 1, 2 or 3 dimensions. Default to your character's current x, y or z.
float Distance[N,W,U:N,W,U] Same as above, just demonstrating that the order is the same as above
string Hex[n] The hex value of n
int Not[n] Performs a bitwise not on n
int Rand[n] Random number with range of n, meaning Rand[n]=0-(n-1). e.g. Rand[2] will give 0 or 1
float Sin[n] The Sin of n
float Sqrt[formula] The square root of formula
float Tan[n] The Tan of n
To String NULL


merchant (inherits spawn)

Members
int Items Item count on the merchant
item Item[n] nth item on the merchant
item Item[name] Finds an item by partial name at this merchant (use merchant.Item[=name] for exact)
To String FALSE, except if a merchant is open gives TRUE
float Markup The value used to calculate item values for merchant (Markup is what your charisma, faction, change)
Markup*Cost=Merchant sell price.
Cost*(1/Markup)=Your sell price. 1.05 is the cap, so there might not be a cap based on charisma.
bool Open Merchant open?

raid

Members
float AverageLevel Average level of raid members (yay more accurate than in the window)
raidmember Leader Raid leader
string Looter[n] Specified looter name by number
int Looters Number of specified looters
int LootType Loot type number (1-leader 2-leader&groupleader 3-leader&specified)
raidmember Member[n] Raid member by number
raidmember Member[name] Raid member by name
int Members Total number of raid members
raidmember Target Raid target (clicked in raid window)
int TotalLevels Sum of all raid members' levels
To String None

Common Examples

Character
/echo ${Me.Buff[1]}
/echo ${Me.Buff[1].Duration.Time}
/echo ${Me.Buff[name].Duration.Time}
/if (${Target.Distance}<11)&&(${Me.AbilityReady[Bash]}) /doability "Bash"
Containers
${Me.Inventory[slot]}
/if (${InvSlot[pack${index}].Item.Container})
/if (!${InvSlot[pack${index}].Item.Container} && ${InvSlot[pack${index}].Item.ID})
${Window[Enviro].Open}
Getting names
${Group[1].Name}
${Target.Name}
${Group[1].Pet.Name}
Getting ID's
/echo ${Cursor.ID}
/echo ${Me.Gem[3].ID}
/echo ${Group[3].ID}
/echo Bat 1: ${NearestSpawn[1,npc bat].ID}
/echo Bat 2: ${NearestSpawn[2,npc bat].ID}
/echo Bat 3: ${NearestSpawn[3,npc bat].ID}
Using Arg

Targetting
/target id ${NearestSpawn[1,pc].ID}
Target the nearest PC
Using Defined
/if (!${Defined[myVar]}) {
/declare myVar int local 0
}
String Comparisons
/docommand ${If[Cursor.Name.Compare[itemname],/autoinv,/destroy}
/if (${String[${Param1}].Equal[yourself]}
/if (${String[${Param1}].NotEqual[${Me.Name}]})
/docommand ${If[${String[TRUE].CompareCS[TRUE]},/echo 1A - true,/echo 1A - false]}
Numeric Comparisons
/if (${AttackOnAssist}==1)
/if (${Target.ID}==${Int[${Param0}]})
/if (${Target.Distance.Int}<100)
/if (!${Me.Combat} && ${DoTraps}==1)
Casting
${Window[SpellBookWnd].Open}
${Me.Casting}
${Me.Gem[1].Name}
Calculations
/if (${Math.Distance[${AnchorX},${AnchorY}]}>${AnchorRadius})
${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading}]}]}
${Math.Distance[${Math.Calc[${Target.Y}-${Me.Y}]}]}
Ini
/varset DoEvade ${Ini[${IniFile},Combat,DoEvade]}
Windows
Window closed
/if (!${Window[pack${PackNum}].Open}) {/echo not open}
/if (${Window[pack${PackNum}].Open}==FALSE) {/echo not open}
/if (${Window[pack${PackNum}].Open}==NULL) {/echo not open}

Window Open
/if ${Window[pack${PackNum}].Open} { do this }

Window Lists
${Window[TradeskillWnd].Child[RecipeList].List[1]}
Get the first-column text for the nth item in a list box
Spawn Searches
${Me.NearestSpawn[1,trigger].Distance}
${Me.NearestSpawn[1,trap].Distance}
${Me.NearestSpawn[1,timer].Distance}
${Me.NearestSpawn[1,untargetable].Distance}
MacroQuest2 and the UI

MacroQuest2 has several built in tooltypes that can be used in custom UI's. These tooltypes allow you to display information in your UI that you normally would not be able to see.

Using Label ID's

The current built-in label ids are:
1000: ${Me.CurrentMana} 2000: ${Target.Level}
1001: ${Me.MaxMana} 2001: ${Target.Class}
1002: ${Me.State} 2002: ${Target.Race}
1003: ${Me.Speed} 2003: ${Target.Distance}
1004: ${Me.Heading} 2004:
1005: ${Me.X} 2005: ${Target.State}
1006: ${Me.Y} 2006: ${Target.X}
1007: ${Me.Z} 2007: ${Target.Y}
1008: ${Me.Dar} 2008: ${Target.Z}
1009: ${Me.Cash} 2009: ${Target.Heading}
1010: ${Me.CashBank} 2010: ${Target.Speed}
1011: ${Me.Platinum)
1012: ${Me.PlatinumShared}
1013: ${Me.Gold}
1014: ${Me.SilverBank}
1015: ${Me.CopperBank}
3000: ${Zone} 4000: ${Macro.Name}
3001: 4001: ${Macro.RunTime}
3002: ${Me.Bound}
3003: ${Time()
3004: ${Time.Hour}
3005: ${Time.Minute}
3006: ${Time.Second}
3007: ${Time.Date}
3008: ${Time.Year}
3009: ${Time.Month}
3010: ${Time.Day}
3011: ${Spawn.GM}
3012: ${Me.FreeInventory}


Example
<Label item =&Target_Level&>
   <ScreenID>TargetLevel</ScreenID>
   <EQType>2000</EQType>
   <Font>2</Font>
   <RelativePosition>true</RelativePosition>
   <Location>
      <X>24</X>
      <Y>33</Y>
   </Location>
   <Size>
      <CX>22</CX>
      <CY>14</CY>
   </Size>
   <Text>0</Text>
   <TextColor>
      <R>255</R>
      <G>255</G>
      <B>0</B>
   </TextColor>
   <NoWrap>true</NoWrap>
   <AlignCenter>false</AlignCenter>
   <AlignRight>true</AlignRight>
   <AlignLeft>false</AlignLeft>
</Label>
MQ2 UI Tooltypes

Another method of adding Label ID's is to use the tooltype.

<EQType>9999</EQType>
<TooltipReference>${variable}</TooltipReference>

Example

<Label item ="BW_Buff0_Duration">
   <ScreenID>Buff0Duration</ScreenID>
   <EQType>9999</EQType>
   <TooltipReference>${Me.Buff1.Duration}</TooltipReference>
   <Font>2</Font>
   <RelativePosition>true</RelativePosition>
   <Location>
      <X>23</X>
      <Y>3</Y>
   </Location>
   <Size>
      <CX>153</CX>
      <CY>14</CY>
   </Size>
   <Text></Text>
   <TextColor>
      <R>255</R>
      <G>255</G>
      <B>255</B>
   </TextColor>
   <NoWrap>true</NoWrap>
   <AlignCenter>false</AlignCenter>
   <AlignRight>false</AlignRight>
</Label>
MQ2 Config Files

These are files containing commands that will be executed at specific times. They can be thought of as macros that run at the specified times.

The file must contain commands the same as you would use them normally. Each command will be executed in order, there are NO macro blocks, events, etc, in a cfg file.

* CFG files may be present in <release>\Configs\, in <release>\, or potentially in the EverQuest directory. Note that <release> would be the same as wherever your Macroquest.ini is.

You can manually load a CFG file while in Everquest using the /loadcfg command:

/loadcfg server_charactername.CFG
Loads a CFG file for the character

Example of an entry in a CFG file for a character:

/custombind add lootcorpse
/custombind set lootcorpse /multiline ; /target corpse radius 17; /loot
/bind lootcorpse f
Configs that are automatically loaded:
AutoExec.CFG Executed on the first pulse
CharSelect.CFG Executed when you are put at character select
server_charactername.CFG Executed when this character enters the world
mapshortname.CFG Executed when you zone into this zone
pluginname-AutoExec.CFG Executed when this plugin is loaded (after its initialization is complete)
Examples of file names
Character
tallon_lordsoth.cfg

Maps
oot.cfg, soldungb.cfg
soldunga.cfg
take.cfg

Plugins
MQ2Map-AutoExec.CFG
MQ2ChatWnd-AutoExec.CFG
Note: Plugins can use LoadCfgFile(filename)

MacroQuest2 Plugins

See /plugin for instructions on how to load and unload plugins

MQ2 has a modular structure that allows different plugins to be loaded and unloaded on demand.

Plugins included with MacroQuest2:

MQ2Bzsrch -- a bazaar search plug-in
MQ2Chat -- Directs MQ2 output to the regular chat window
MQ2ChatWnd -- Directs MQ2 output to a special chat window (safer)
MQ2EQBugFix -- fix a crash(!) when exiting with no journal entries
MQ2EQIM -- EQIM
MQ2CustomBinds -- Allows you to specify custom commands to execute on a key combination
MQ2FPS -- frame limiter (similar to EQPlayNice)
MQ2IRC -- IRC plugin
MQ2ItemDisplay -- Add extra data to item windows
MQ2Label -- allows custom UI labels
MQ2Map -- enhanced map
MQ2Telnet -- act as a telnet server for macro output
MQ2Bzrsrch Plugin

TLOs
bazaar Bazaar Bazaar search info

Data types

bazaar

Members
bool Done Search complete?
int Count Result count
bazaaritem Item[n] Result info by index (1-based)
To String Same as Done

bazaaritem

Members
string Name Item name
spawn Trader The guy selling it
int Price Price the guy is selling it for
int Quantity Number of this item this guy has
int ItemID The item's ID number
int Value Value of the item?
To String Same as Name


MQ2Chat Plugin

This plugin enables output of MacroQuest2 commands to the normal chat window.

To disable this plugin
/plugin MQ2Chat unload
To enable this plugin
/plugin MQ2Chat
MQ2ChatWnd plugin

This plugin adds an additional window to your UI.

This window will display ALL information generated by MacroQuest2 commands and macro's.

Note: Any information displayed or typed in this window will NOT go into your character log. It is invisible to EverQuest.

If you don't want to use MQ2ChatWnd you can use the default chat plugin (or both).

To disable MQ2ChatWnd
/plugin mq2chat
loads the default chat plugin (normal chat window)

/plugin mq2chatwnd unload
unloads the MacroQuest2 chat window
Once you do the above two commands, all output from MacroQuest2 and normal EverQuest commands will go to your log, and will be visible to EverQuest.

Be careful if doing a /report or /petition. MacroQuest2 output visible in x number of lines will be sent.

MQ2CustomBinds plugin

Allows you to specify custom commands to execute on a key combination.

There may be a command for the keys being pressed (down), and another for them being released (up).

Syntax
/custombind list | [add|delete| clear] name [-down|-up] | set name [ -down|-up ] command
Examples
/custombind list
Lists all of your custom binds names and commands (the key combinations must be set using /bind)

/custombind add name
Will add a new bind name for use here, with /keypress, /bind, etc.

/custombind delete name
Removes a custom bind

/custombind clear name
Clears a specific command for a custom bind. If -up or -down is not specified, defaults to -down.

/custombind set name [-down|-up] command
will set a specific command for a custom bind. If up or down is not specified, defaults to down.

Example usage (NOTE: MQ2's very first bind command is "RANGED" so you do not need to do this, but for example)
/custombind add mybind
/custombind set mybind /ranged
/bind mybind g
To set the real RANGED bind, do "/bind ranged "
MQ2EQIM plugin
Notifies you when someone on your EQIM buddy list changes. Keeps track of your buddy list

Keeps your list of buddies (per character) and the last time they were seen online or on eqim (by any character)
Your friends list is automatically added as buddies.

Data types

buddy

Members
int Buddies Size of the buddy index (will not necessarily be equal to the number of buddies, but n in Buddy[n] will never exceed this number)
string Name Buddy's name (may be fennin.Name or just Name, depending on how you added them)
string Status "Removed from list", "Offline", "EQIM", "EQIM (AFK)", "Unknown Status(4)", "Playing", "Playing (AFK)"
int StatusID Numeric representation of the above (0,1,2,3,4,5,6)
time LastSeen Last time this buddy was on/seen
To String Same as Name

Top-Level Objects
buddy Buddy[name] Info on buddy with this name
buddy Buddy[n] Buddy with this index number in the system


MQ2FPS plugin

Changes the frames per second of the Everquest screen when it is in focus and when it is in the background.

This frees CPU processing time for other tasks. The default setting is foreground: 50 background: 20

MQ2FPS now releases the CTRL ALT and SHIFT keys as soon as EQ goes to the background.

MQ2FPS commands
/maxfps fg|bg #
Sets the foreground or background framerate

/fps mode [absolute|calculate]
Changes the mode used by /maxfps to absolute or calculate. You can specify the mode, or use /fps mode to toggle between the two.

/fps on|off
Enables or disables the framerate display

/render fg|bg #|~#
Sets the foreground or background rendering rate. This is how many out of n frames MQ2FPS will allow to be drawn. You keep moving full speed, the client responds to mouse or keys, the UI is still drawn... but, the world itself will not be drawn as often.

The use of # will cause MQ2FPS to draw 1 of # frames.
The use of ~# will cause MQ2FPS to draw n - 1 frames, where n is #. Examples
/render bg 3 Draws 1 out of 3 frames /render bg ~3 Draws 2 out of 3 frames
MQ2FPS plugin adds these Top-Level Objects (these are NOT in the standard reference because they are from a plugin not built in)
float FPS Current frames per second
int MaxFPS Current max frames per second
bool Foreground Is this session in the foreground?


MQ2HUD plugin

Provides additional functionality to the HUD included with MQ2. It allows you to add additional elements. Every element gets parsed for MQ2Data each time it is displayed.

The additional fuctionality is added via the use of an ini file.

MQ2HUD allows for different HUDs. Each different HUD is stored in MQ2HUD.ini but in different sections.

The default HUD is [Elements]. To load a different HUD, the command is /loadhud name (not case sensitive)

Example

/loadhud bard

In this case, the [bard] section in MQ2HUD.ini could also be [BARD]

The command to load the default HUD specifically is /defaulthud
Example MQ2HUD.INI

[Elements]
;The order is TYPE,X,Y,RED,GREEN,BLUE,TEXT
TargetInfo=3,5,35,255,255,255,${Target}
GMIndicator=3,5,45,0,0,255,${Spawn[gm]}
CursorItemName=7,-15,-15,255,255,255,${If[${Cursor.ID},${Cursor},]}
ClickMeForFun=6,-25,-25,255,255,255,${If[!${Cursor.ID},click me,]}

TYPE is currently any combination of the following:

1 - Display in non-full screen mode
2 - Display in full screen mode ("f10 mode")
4 - X,Y is based on cursor location

e.g. 1+2+4=7. 7 means all 3 of the above. 6 means 2 and 4. 3 means 1 and 2. Just add them together. There is no way to end up with a number that could mean two different combinations.
Seeing as how the mouse functions perfectly fine in full screen mode, the cursor has been forced to display the same as it would in UI-visible mode. The only difference is the item is not displayed on your cursor. With MQ2HUD and the "CursorItemName" example, you could have it show the name of the item attached to your cursor in full screen mode (use type 6 if you want it to follow your cursor in full screen mode only).

X,Y is the screen location. 0,0 is the upper left corner fo your screen.

Red, Green and Blue are each from 0 to 255. 255,255,255 is white, 0,0,0 is black.

Slash Commands
/defaulthud
Load the default HUD specifically

/hud normal|underui|always

normal will make the HUD display as it would normally on top of UI, not at char select or in "f10 mode"
underui will make the HUD display as normal except UNDER the UI, and not at char select or in "f10 mode"
always will make the HUD display under the UI, at char select, and in "f10 mode"

/loadhud hudname (not case sensitive)
Loads a HUD by the name hudname. This HUD must have a [hudname] section in MQ2HUD.ini

Note: There is currently no command to add or remove these from inside the game. One will probably be added soon. The plugin will automatically re-load the list from the .ini when you modify and save the .ini.
Top Level Objects
string HUD Name of currently loaded HUD


MQ2Map plugin

MQ2Map is the plugin which provides additional functionality to the in game map.

To find what options are available type /mapfilter help

Slash Commands

/highlight "spawnname" [color # # #] [reset]
Temporarily highlights these spawns

Right clicking on spawns on the map targets them

Note: You can use search filters for spawnname

/highlight color # # #
Sets the highlight color to an RGB value

/mapclick keycombo command option
command and special right click commands (hold a combination of shift, control, left alt, right alt to execute a special command when right clicking on a spawn). Defaults include left-alt right-click to highlight and control r-click tohide.

Example

/mapclick lalt+shift /mycommand %i
leftalt+shift right click on a spawn will cause /mycommand to be executed.
/mapfilter help|option [color R# G# B#]

Map filtering options:
all Enables/disables map functions
CastRadius # Sets radius of casting circle to # (omit or set to 0 to disable)
Corpse Displays corpses
Custom Sets custom filter (omit to disable). Used same search options as /target and the Spawn search TLOs
Ground Displays ground items
Group Displays group members in a specific color
Help Displays the available options for /mapfilter
Menu Allows display of right-click context menu
Mount Displays mounts
NormalLabels Toggles non-MQ2 label display
NPC Displays NPCs
NPCConColor Displays NPCs in consider colors
PC Displays PCs
PCConColor Displays PCs in consider colors
Pet Displays pets
Target Displays your target
TargetLine Displays a line to your target
TargetMelee # Draws a melee-range circle around your target
TargetRadius # Sets radius of a circle around your target to # (omit or set to 0)
Timer Displays Timer objects on the map
Trap Displays trap objects on the map
Trigger Displays hidden triggers/traps
Untargetable Displays untargettable spawns on the map
Vector Displays heading vectors

The color R# B# G# option is used for npcs/pcs/triggers etc that are displayed on the map.

When using the Custom option, you can use the same spawn search options available in MacroQuest2 to select spawns for display, such as ${Spawn[searchfilter]} where searchfilter is the same syntax as that used in /target.

Examples
/mapfilter Ground
Toggles ground spawns on or off

/mapfilter custom npc range 40 65
Displays all npcs of level range 40 to 65

/mapfilter custom npc range 60 65 radius 50
Displays all npcs of level 60 to 65 within a radius of 50

/mapfilter custom npc range 60 65 radius 50
Displays all npcs of level 60 to 65 within a radius of 50

/mapfilter Trigger color 200 200 0
Sets the color of Triggers

Note: The use of custom is a one time event, it is not persistent.

/maphide "spawnname" [reset]
command to hide spawnname from the map. Hidden spawns are in effect until the mapped spawns are re-generated (such as changing some map filters)

/maphide reset
Re-generates the spawn list.

/maphide npc range 1-39
Hides all spawns level 39 and below

/mapnames normal | target options
You have the option of using the /mapnames command to set the way real spawn names are displayed for a) your current target, or b) normally.. You can set up a custom scheme using special "%" codes made up just for this.

Here are a few examples for explanation
/mapnames normal [%l %R %C] %N /mapnames target [%l %R %C] %N (%x, %y, %z)
The command takes a parameter specifying normal/target, and then the custom string. The plugin will replace the %l %r %c %N stuff with a piece of information. Each code is CASE SENSITIVE and exactly one character in length. It is important to note that names are NOT updated continually, except for your target if the target map filter is on. In testing the system was approximately 4 times as slow if all names were updated continually.

Here are the existing % codes right now; more can be added later:
n - "Decorated" name like "a_coyote34"
N - "Cleaned up" name like "a coyote"
h - Current health %
i - SpawnID
x - X coordinate
y - Y coordinate
z - Z coordinate
R - Race full name - lower case "r" is reserved for race 3-letter code
C - Class full name - lower case "c" is reserved for class 3-letter code
l - Level
% - shows a % sign (so if you want your health display to show "100%" you would use %h%%)

/mapshow "spawnname" [reset]
command to explicitly show spawnname on the map. Only in effect until the mapped spawns are re-generated (same as maphide).

Top Level Objects
spawn MapSpawn Object that is created when your cursor hovers on a spawn on the map

Example
${MapSpawn.ID}
MQ2Telnet plugin

Telnet Server

Enabling
You must enable the telnet server in macroquest.ini's [Telnet Server] section.
Set Enabled=1 and set a valid Port=###
Also, please set a "Welcome=message" and definitely a private "Password=junk"

Using telnet
Use a real telnet client. (Putty works well for this)

Connect to the system running EQ/MQ using the port you have in your ini.
You should see your Welcome message and a password prompt. (Enter it ;)

Anything you type into the telnet session will be sent to the client and executed directly (like a macro statement)

Any chat output will be sent to your telnet session.

Slash Commands

/telnet
Displays a list of all remote IP addresses for open telnet sessions.

Ending
Close the telnet client, MacroQuest2 will clean up when it notices the socket is gone.

Telnet plugin ini

To disable telnet capability you set port=0 under [Telnet Server]

You can configure the telnet plugin to allow single user or multiple user access.

For single person access to your character via telnet, set LocalOnly=1 under [Telnet Server]

For multiple user access you would have entries under [Users] for each person allowed access. You must make an entry of username=password for each person. LocalOnly must also be set to 0.

MQ2Telnet ini snippet
;**********************************************************************
; for use with the telnet server plugin -- mq2telnet
;**********************************************************************
[Telnet Server]
; port = 0 off, else put the port number here
Port=6669
; localonly boolean -- supposedly does a get peer name to compare address
; but you must use the hostname not 127.0.0.1 or localhost when connecting
LocalOnly=0
Welcome=YAY!!! ya made it!!! n00b!
LoginPrompt=login:
PasswordPrompt=password:
[Users]
;username=password
wassup=ubahmanualguy
twister=god
setting port=0 will disable the Telnet capability
setting LocalOnly=1 will prevent others from telnet access

1. To Create a plugin, you need to use the command line program mkplugin.exe, which exists in the main directory of the MacroQuest2 source files.

Example

    mkplugin myplugin

This will create a plugin named "MQ2Myplugin"

If you don't know how to use DOS, you should do this:

   Start->Run: c:\mq2\mkplugin myplugin

Replacing c:\mq2\ with the path to where you have the MacroQuest2 source files at.
2. Add the new plugin to your Visual Studio workspace (Visual C++ is part of Visual Studio, so this is the same as adding it to your Visual C++ workspace).

   In VS .NET, go to File->Add Project->Existing project, and select the MQ2Myplugin.vcproj.

   In VS 6, Go to Projects->Insert Projects into workspace, then select MQ2Myplugin.dsp.

3. Open the MQ2Myplugin.cpp file. Select all of it, and replace it with the code you're copying

4. Compile the plugin. If you cant figure this step out then you need to seek help elsewhere

5. Load the plugin.

Example: /plugin mq2myplugin

Appendix A: Operators

Numeric Operators
+ Addition
- Subtraction
/ Division
\ Integer Division
* Multiplication
% mod
^ Exponent
& Bitwise AND
| Bitwise OR
~ Bitwise NOT
^^ XOR
<< Bitwise shift left
>> Bitwise shift right

Logical Operators
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
&& AND
| | OR
! NOT


Appendix B: /keypress list
Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
` 1 2 3 4 5 6 7 8 9 0 - = Backspace
Tab Q W E R T Y U I O P [ ] \
Caps_Lock A S D F G H J K L ; ' Enter
Shift Z X C V B N M , . / Right_Shift
Ctrl Alt Space Right_Alt Right_Ctrl


Prnt_Scrn Scroll_Lock
Insert Home Page_Up Num_Lock Num_/ Num_* Num_-
Delete End Page_Down Num_7 Num_8 Num_9 Num_+
Num_4 Num_5 Num_6
Up Num_1 Num_2 Num_3 Num_Enter
Left Down Right Num_0 Num_Del


Note: keymap names will be added soon. Until then you can get them using the /bind command. The use of the keymap names requires the use of the /keypress command.

Appendix C: Skills List

1H Blunt 1H Slashing 2H Blunt
2H Slashing Abjuration Alteration
Apply Poison Archery Backstab
Bind Wound Bash Block
Brass Instruments Channeling Conjuration
Defense Disarm Disarm Traps
Divination Dodge Double Attack
Dragon Punch Duel Wield Eagle Strike
Evocation Feign Death Flying Kick
Forage Hand To Hand Hide
Kick Meditate Mend
Offense Parry Pick Lock
Piercing Riposte Round Kick
Safe Fall Sense Heading Sing
Sneak Specialize Abjure Specialize Alteration
Specialize Conjuration Specialize Divination Specialize Evocation
Pick Pockets Stringed Instruments Throwing
Tiger Claw Tracking Wind Instruments
Fishing Make Poison Tinkering
Research Alchemy Baking
Tailoring Sense Traps Blacksmithing
Fletching Brewing Alcohol Tolerance
Begging Jewelry Making Pottery
Percussion Instruments Intimidation Berserking
Taunt Slam


Appendix D: Containers List

Alchemy Baking Blacksmithing
Brewing Firing Fishing
Fletching Fletching WoodElf Jewelry Making
Make Poison Medicine Quest
Merchant Mixing Pottery
Regular Research ??? Research ENC
Research MAG Research NEC Research WIZ
Research Practice Tailoring Tailoring Halfling
Tinkering

Appendix E: Slot Names

Equipment Slots (0-21)
0 charm
1 leftear
2 head
3 face
4 rightear
5 neck
6 shoulder
7 arms
8 back
9 leftwrist
10 rightwrist
11 ranged
12 hands
13 mainhand
14 offhand
15 leftfinger
16 rightfinger
17 chest
18 legs
19 feet
20 waist
21 ammo

Inventory Slots
pack1 - pack8 Your pack slots
22-29 character general inventory slots
bank1 - bank16 Character bank slots
sharedbank1 - sharedbank2 Shared bank pack slots

Others
trade1 - trade8 Trade Window
loot1 - loot31 Corpse window
enviro1 - enviro10 Environmental containers (forge, kiln, etc...)
merchant1 - merchant80 Merchant window
bazaar1 - bazaar80 Bazaar search window
inspect1 - inspect31 Inspect window

Appendix F: Spawn Search filters

The following filters are allowed in using spawn searches with any command using a spawn search:

pc
npc
pet
nopet
corpse
trigger
untargetable
trap
check
timer
any
next
prev
lfg
gm
group
trader
range lowerlevel upperlevel
loc intX intY
id intid
radius floatR
body bodytypename
class classname
race racename
light lightname
GUILD
guild guildname
alert n
noalert n
notnearalert n
nearalert n
zradius floatR
notid n
nopcnear floatR
named level

MacroQuest2 FAQ

Q: What is this error: fatal error C1083: Cannot open include file: 'MQ2Auth0.h': No such file or directory
A: Run mq2auth.exe in the location it was extracted to

Q: I dont see any output when I run a macro
A: /filter macros all

Q: On patchday or a few days after a patch, EQ crashes when I try to use MQ2
A: Wait until a new release of MQ2 is announced, every time eqgame.exe is patched, MQ2 needs a "patch"

Q: I get this: MQ2Main fatal error LNK1279: invalid or corrupt file: file contains invalid .sxdata contributions
A: Before doing the MQ2Main build:
1. Select Build->Clean 2. Build->Batch Build and select only the Release versions
Q: fatal error C1083: Cannot open include file: '..\Dxsdk81\include\dinput.h': No such file or directory
A: Extract the MQ2-Latest.zip in its original state. You need to unzip the archive using include directory names.
You should end up with this sort of directory tree:

c:\macroquest\dx81sdk
c:\macroquest\mq2main
c:\macroquest\release
Q: What files can I delete in the Release folder after compiling MQ2?
A: Any file with extensions other than dll, exe, ini, cfg, and .txt

Q: Why can't I find the .dll files in the Release folder after I compile?
A: Make sure you do not have "hide sys files" set in your folder options.

Q: How do I create macro's that work on the non-US servers? My macro's require text with umlauts and accents.
A: Use the correct spelling with accents, umlauts and such in your corresponding language and save the macro as UTF-8 instead of ANSI.