MacroQuest2 Manual
Last Updated: June 22, 2007
http://macroquest.sf.net/

Valid HTML 4.01! Valid CSS!

The most current readme.chm version is available here

Please help contribute to our wiki also. Once all of the information from this manual is moved over, the HTML version of the manual may be discontinued.

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 Heading If
Ini Int InvSlot LastSpawn LineOfSight Macro Macroquest Math
Merchant NamingSpawn NearestSpawn Plugin Raid Select SelectedItem Skill
Spawn SpawnCount Spell Switch Target Time Type Window
Zone

Reference Types

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


Immediate Types

argb bool body byte class corpse deity evolving
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
     MQ2IRC
     MQ2ItemDisplay
     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
Appendix F: Spawn Search filters
Appendix G: Windows List
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
   :OnExit
/return
Everything within Sub Main is performed once you start the macro.
Anything included after :OnExit will be called whenever an /endmacro command is issued. The use of :OnExit is optional.

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, which is also the maximum value. 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.

#chat channelname
Defines which channel chat events will be queued from.

Valid channels are: auc, chat, guild, group, ooc, say, shout, and tell.

Only one channel may be used.

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| aliasname delete] [ 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 aliasname delete
Deletes aliasname from Macroquest.ini
/altkey command
Execute a command while telling the window manager that the alt key is pressed. Can also be used together with /ctrlkey and/or /shift, as in /ctrlkey /altkey /shiftkey 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.

/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 # MQCaptions [on|off]
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.
When using MQCaption if no parameter is given, the default parameter is off

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}" | #] [ item " itemname"] [ list]
Will cast the specified spell, or perform a right click of an item that has a right click spell
/cast "complete heal"
/cast "${SpellName}"
/cast 1
/cast item "mana robe"
/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 [center]| 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
/click left center Performs a left click in the center of the viewport area

*** Note: /click does not work on UI windows or anything out of the viewport area.

/combine pack n
Activates the Combine button combine of pack
Example

/combine pack8
/ctrlkey command
Execute a command while telling the window manager that the ctrl key is pressed. Can also be used together with /altkey and/or /shiftkey, as in /ctrlkey /altkey /shiftkey 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

/doability combatabilityname
Activates combatabilityname if it is ready to be used

/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 ( formula) { command(s) } Runs command(s) if formula evaluates to something other than 0.

formulas are ONLY numeric operations. You must use MQ2Data string comparison to turn string comparisons into numeric operations.

formula 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)

There is no need to use MATH.CALC in /if statements.
Example

/if (${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
spellradius Displays a circle on the map, normally for spell radius.
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


/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
You can use /notify to click on a link in the chat window.

Use the following command:

/notify ChatWindow CW_ChatOutput link <link structure>

<link structure> consists of 44 characters of the link starting with the 2nd character of the item id (ie, drop the leading 0).

/plugin list | name [noauto] | unload [noauto]
Lists, loads, and unloads plugins. Using the noauto switch prevents updating of Macroquest.ini when loading or unloading the plugin

/plugin name noauto
loads name without updating Macroquest.ini

/plugin name unload noauto
unloads name without updating Macroquest.ini
/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
/shiftkey command
Execute a command while telling the window manager that the shift key is pressed. Can also be used together with /altkey and/or /ctrlkey, as in /ctrlkey /altkey /shiftkey command

Example

/shiftkey /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:
clear Clears your current target
pc|npc Selects nearest pc or npc.
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

Note: The AltAbility TLO should not be used except for experimental data. If you've already purchased the AA, use Me.AltAbility. Me.AltAbility is much faster.
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
group Group

access to type(s): group

Makes a group object called Group

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):