Skip to content

Plugins

Introduction

Plugins extend the functionality of MQ, usually at a lower level than macros do. For example, a macro may help you do automatically mez mobs within a certain range, or auto-attack mob within a certain range. A plugin may control lower level functions like casting the mez spell for you (ie. making sure you have the right target, auto-recasting if you fizzle, etc) or control movement to your intended victim and activating attack (ie. moving you to melee range, turning on attack, automatically backstabbing, turning off attack on enrage, etc).

The functionality of plugins and macros often overlap, and in the above example its completely possible to do all the above using just a macro with no plugins.

Plugins are written in C++ whereas macros use MQ2's internal scripting language. The internal scripting language is a lot easier to use and manipulate than C++, which is why you'll find a lot more macros than plugins on the MQ2 message boards.

Finding Plugins

Plugins can be found in the following forum:

MQ2::Development::Plugins (VIP Only)

ImaNoob posted a very helpful thread here. (VIP Only) Titled appropriately "The Complete Idiots Guide to MQ2 and plugins"

Compiling Plugins

Say you've seen an interesting looking plugin on the forums and you'd like to try it out, how exactly do you go about doing it?

  • Open up a command prompt (Windows key + R, type "cmd" without quotation marks, press enter) and navigate to your MQ2

source directory (eg. cd \mq2-latest).

  • Type "mkplugin". Use the name of the plugin from the forum post (eg. "mkplugin MQ2Melee").
  • This will create the directory under your MQ2 source root and add a few files in there. Go to this directory in

Explorer and open the .cpp file (eg. MQ2Melee.cpp) in your favourite text editor (notepad will work

just fine). If you don't have any file extensions on your files (ie. none of them end with .cpp), then in Explorer

go to Tools - Folder Options - View tab and untick "Hide file extensions for known file types".

  • Replace the contents of this file with the code copied from the forum post. This code will generally start with

a header indicating the name of the plugin, author, and maybe a brief description of the function of the plugin. An

example of the first few lines of the MQ2Melee plugin are below:

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// MQ2Melee.cpp |
// Author: s0rCieR |
// Version: 3.000 |
// Date: 20060213 |yes it should be
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// #define aabug when alt abilities broken!
// #define cabug when combat abilities broken!
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

#include <mq/Plugin.h>

PreSetup("MQ2Melee");
PLUGIN_VERSION(3.000);
  • Some plugins require additional files to be included as well (eg. .ccp, .h or .inc). Just create these files in the

plugin directory with the names as given in the forum post. **Make sure to save them as plain text documents with

the correct extension (ie. do not save them with .txt extension) otherwise the plugin will not find them.**

  • After you've got the plugin created and all the files copied, open up the main MacroQuest2 project and add your

newly created project:

  • In VS 6, Go to Projects->Insert Projects into workspace, then select .dsp (eg. MQ2Melee.dsp).
  • In VS .NET, go to File->Add Project->Existing project, and select the .vcproj (eg.

    MQ2Melee.vcproj).

  • In VS 2005 AND NEWER, go to File->Add->Existing project, and select the .vcproj (or .vcxproj in

    newer versions of VS} (eg. MQ2Melee.vcproj or MQ2Melee.vcxproj).

  • Compile the plugin:

  • In VS 2005 and newer, click on the plugin name in the Solution Explorer window, then click Build->Build

    .

Using Plugins

MQ2 plugins are modular and can be loaded and unloaded on demand.

See /plugin for information on loading and unloading plugins.

  • If you need help with the plugin, you can most often find it within the main forum post or within the Wiki entry for

that plugin. Some plugins have a built in help which can often be accessed in-game by typing the name of the

plugin's slash command(s) followed by help, or just the slash command\(s\) by itself. (more examples?)

  • For example, in the MQ2MoveUtils plugin, the plugin adds the /moveto and /makecamp slash commands. Typing

    "/moveto help" and "/makecamp help" will bring up a list of current options for that part of the

    MQ2MoveUtils plugin.

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)
  • MQ2CustomBinds -- Allows you to specify custom commands to execute on a key combination
  • MQ2EQBugFix -- Currently nothing, but reserved for fixing bugs in EQ itself
  • MQ2EQIM -- EQIM
  • MQ2HUD -- Provides additional functionality to the HUD included with MQ2
  • MQ2IRC -- IRC plugin
  • MQ2ItemDisplay -- Add extra data to item windows
  • MQ2Labels -- allows custom UI labels
  • MQ2Map -- enhanced map
  • MQ2Telnet -- act as a telnet server for macro output

List of Plugins with wiki pages

Troubleshooting

See General Help for troubleshooting plugin problems.

Writing Your Own Plugins

See Developing Plugins for further information.

Unloading a plugin from within a plugin

Because call UnloadMQ2Plugin(name) from within a plugin will crash, you must use a macro command to unload the plugin. DoCommand(NULL, "/timed 20 /plugin unload"); will queue the macro command to unload after two seconds.