MacroQuest2:Plugins

From MacroQuest Wiki

Contents

Introduction

Plugins extend the functionality of MQ2, 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)

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 (Start - Run - "cmd") and navigate to your MQ2 source directory (eg. cd \mq2-latest).
  • Type "mkplugin <plugin_name>". 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 <plugin_name>.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 "../MQ2Plugin.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 <plugin_name>.dsp (eg. MQ2Melee.dsp).
    • In VS .NET, go to File->Add Project->Existing project, and select the <plugin_name>.vcproj (eg. MQ2Melee.vcproj).
    • In VS 2005, go to File->Add->Existing project, and select the <plugin_name>.vcproj (eg. MQ2Melee.vcproj).
  • Compile the plugin:
    • In VS 2005, click on the plugin name in the Solution Explorer window, then click Build->Build <plugin_name>.

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 Popular Plugins

  • MQ2AutoSkills -- perform skills as they become available
  • MQ2Bandolier -- provides functionality similar to the EQ Bandolier, but for any inventory slot
  • MQ2Cast -- advanced casting handler, with ability to recast, swap in focus gear and much more
  • MQ2Clip -- allows you to adjust your clip plane on EQ sessions that are in the background
  • MQ2Cursor -- handles items on your cursor (auto keep/destroy) and handles auto-eating of other food/drink to preserve your stat food/drink
  • MQ2DPS -- instant damage per second calculation
  • MQ2Exchange -- exchanges items between general slots/bag slots and inventory slots
  • MQ2EQBC -- provides a simple IRC-style client and server to enable bots to communicate quickly and safely
  • MQ2FakeLink -- fake link generator
  • MQ2FeedMe -- controls automatic eating and drinking of defined foods/drinks (to preserve special stat food)
  • MQ2FPS -- Control framerates of foregrounded and backgrounded sessions
  • MQ2HUDMove -- easy in-game HUD moving
  • MQ2Linkdb -- store, search, and display in game links
  • MQ2Melee -- Auto-combat and skills
  • MQ2MoveUtils -- assorted movement functionality
  • MQ2Targets -- Spawn tracker with /where and MQ2HUD syntax
  • MQ2Timer -- add timer functionality
  • MQ2Tracking -- add EQ style tracking to all classes
  • MQ2Twist -- auto song twisting
  • MQ2Vendors -- will automatically alert you when the merchant you are browsing has any items you are looking for

Troubleshooting

See Help:Plugins for troubleshooting plugin problems.

Writing Your Own Plugins

See MacroQuest2:Extending 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 <plugin name> unload"); will queue the macro command to unload after two seconds.