WoW:Useful patterns in macros

Revision as of 20:13, 1 March 2007 by WoWWiki>Qzot
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Macros
General guides

This page is intended to provide patterns that may be useful in constructing your own macros, filling a niche between a reference page for macros (HOWTO: Make a Macro) and a list of generally Useful macros.

Managing Focus

'Focus' is a UnitId newly available in WoW 2.0 which provides for a means for macros (and addons under keyboard/mouse control) to 'remember' some other UnitId. Unit frame addons allow a player to track the health and status of the focused unit while targeting other units. Macros can be written to cast spells on the focused unit. Moreover, click-style addons such as Clique can be used on the focus' unit frame as appropriate. These possibilities are the motivation for including focus management in macros.

Sheep/Monitor/Resheep Pattern

/focus [target=focus,exists,nodead] focus;
/cast [target=focus,harm,nodead] Polymorph

This will leave your current focus as-is if there is a focused unit and it's alive; otherwise your focus will be set to your current target. (The ';' is not a line terminator -- means that if [target=focus,exists,nodead] did not evaluate true, then attempt to execute a /focus command with no arguments.) Then, once your focus has been set, if it is an enemy, Polymorph it.

As a result, this macro can be placed on the action bar, and be used as a single-button solution to sheep an initial target (as long as you have no focus, or it's dead), to be able to monitor the status (i.e., to know when it should be resheeped), and to resheep as necessary.

Last Pet Target Pattern