Macros are essentially scripts that run certain MQ2 commands when certain conditions are met.
As an example, say you want to create a macro that repeatedly casts a certain spell (eg. if you were trying to train up your Divination skill). The macro could do something like this:
- Cast "True North" spell
- Check mana and if not enough mana to cast the above spell, sit down and rest until mana is full.
- If you have enough mana to cast the spell, then loop back to the beginning.
Macros can also be triggered off of things that happen in game. For example, you can create a macro that waits until someone says "Heal Me" in group, and then casts a heal on that person.
A snippet is a portion of macro code that can be re-used in lots of different macros. One of the most popular snippets of code is the spell_routines snippet, which casts a spell reliably (ie. deals with fizzles, target being out of range, etc). This snippet can be included in many different macros so that all of them benefit from the increased functionality.
Snippets help keep key pieces of code separate from the main macro, which makes it easier to update portions of big macros.
Please Note: VIP macros and snippets are only available on the VIP forums.
Finding Macros and Snippets¶
You can find Macros in the following Forums:
Snippets can be found here:
Using Macros or Snippets that you have found¶
Using a macro is simply a matter of copying and pasting the code from the forum into a text file and placing the resulting file into the Release\Macros directory.
Macros with a .mac extension can be run without typing the ".mac". Macros with other extensions require you to type the extension for the /macro command to work.
In game, you can run the macro with the following command:
Sometimes macros have additional arguments that you can pass to them when starting. These need to be added to the end of the /macro line, like so:
/macro1 2 3
The main macro post and/or the comments at the top of the macro should tell you how the macro needs to be run.
Just like a macro, a snippet needs to be copied into a text file. Traditionally, snippets have a .inc file extension, but there are no restrictions as to what the file is called.
To use a snippet, add a line like the following examples, to the top of your macro before the Main sub:
List of popular Macros and Snippets¶
|List of non VIP Macros
|List of Non-VIP Snippets/Includes
|List of VIP Macros
|List of VIP Snippets/ Includes
Creating your own Macros¶
Creating your own macro is a rewarding and fun experience, although there is a bit of a learning curve if you've never scripted before.
See the Macro Reference for information on how to create your own macros.
See General Help for Help and Troubleshooting information.