Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:Making a macro
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Conditionals== Now you'll get to see the complete list of conditionals and what they mean. Each conditional will be treated more thoroughly below. === Complete list === Below is the entire list of conditionals that are available to the macro system. One of the goals in the 2.0 patch was to eliminate a lot of old "smart buttons" that allowed people to essentially play the entire game spamming one key repeatedly. However, many tasks people used macros to simplify were deemed OK and given Blizzard's blessing via the macro options. If you don't see a condition listed here, then there is no way to check for it and take a combat-related action. These are essentially non-negotiable though they may be augmented in the future. Many of these can be checked for falseness instead of trueness. For example, [nocombat] is a valid conditional and will only perform the actions following it if you are not in combat. * '''actionbar:1/.../6''' or '''bar:1/.../6''' — Given action bar page is selected * '''bonusbar:5''' — The possess bar is active (controlling a vehicle or another player) * '''button:1/.../5/''<virtual click>''''' or '''btn:1/.../5/''<virtual click>''''' — Macro activated with the given mouse button * '''channeling:''<spell name>''''' — Channeling the given spell * '''combat''' — In combat * '''cursor''' — What the cursor is currently holding, see [[API_GetCursorInfo]] for types * '''dead''' — Target is dead * '''equipped:''<item type>''''' or '''worn:''<item type>''''' — item type is equipped (item type can be an inventory slot, [[ItemType|item type]], or item subtype) * '''exists''' — Target exists * '''flyable''' — In a zone where flying is allowed (this does not check if you have [[Cold Weather Flying]]; if you are in a flyable zone, but do not have this skill, the macro fails) * '''flying''' — Mounted or in flight form AND in the air * '''group:party/raid''' — You are in the given type of group * '''harm''' — Can cast harmful spells on the target * '''help''' — Can cast helpful spells on the target * '''indoors''' — Self explanatory * '''modifier:shift/ctrl/alt''' or '''mod:shift/ctrl/alt''' — Holding the given key * '''mounted''' — Self explanatory * '''outdoors''' — Self explanatory * '''party''' — Target is in your party * '''pet:''<pet name or type>''''' — The given pet is out * '''raid''' — Target is in your raid/party * '''spec:1/2''' — Currently active class specialization * '''[[Stance|stance]]:0/1/2/.../n''' or '''form:0/.../n''' — In a stance * '''stealth''' — Stealthed * '''swimming''' — Self explanatory * '''talent:<''tier#''>/<''column#''>''' - talent from column# of tier# is selected * '''unithasvehicleui''' — The target of the macro has vehicle UI * '''vehicleui''' — The player has vehicle UI === help and harm === The [help] condition is true when the unit can receive a beneficial effect, e.g., a healing spell. The [harm] condition is true when the unit would get an adverse effect, e.g., a damaging spell. === exists === This determines whether the given unit exists. In other words, if you don't have a target, [exists] will return false. If you have a focus, [target=focus, exists] would be true. Note that in some cases [exists] is unnecessary. [help], [harm], [dead], [party], and [raid] all imply [exists] if they're true. === dead === If you have a target and it's dead, this will be true. === stance and form === : stance:0/1/2/.../n or form:0/1/2/.../n Stance is the generic term used for Warriors', Druids', Rogues' (Stealth), Priests' (Shadowform) and Shaman's (Ghost Wolf) forms. Stances are only applicable to situations where certain abilities are only usable in specific forms. Because of this, Paladin auras and Death Knight presences (despite being on the shapeshift bar), and Hunter aspects are NOT considered stances. The simplest form of [stance], as mentioned previously, means that you are in any stance whatsoever. It is equivalent to [stance:1/2/3/.../n] where n is the number of stances you have. [stance:0] is equivalent to [nostance] so you can use a conditional like [stance:0/3] to evaluate as true if you are either in stance 3 or not in any stance. Form is an alias for stance. The condition [form:1] will work exactly the same as [stance:1]. The stances themselves are ordered the same way as they appear on your shapeshift bar. So a Druid with Bear, Aquatic, Cat, and Travel forms would have stances 1 through 4. Here is a simple chart to help you remember stance numbers: {| class="darktable ww-tight" style="margin:auto 0; padding:4px; width:100%;" ! !!Warrior!!Druid!!Priest!!Rogue!!Shaman!!Warlock |- | Stance 1 || [[Battle Stance|Battle]] || [[Bear Form|Bear]] || [[Shadowform]] or<br />[[Spirit of Redemption]] || [[Stealth]] || [[Ghost Wolf]] || <s>[[Metamorphosis|Demon Form]]<s> || |- | Stance 2 || [[Defensive Stance|Defensive]] || [[Cat Form|Cat]] || || [[Shadow Dance]] || || || |- | Stance 3 || [[Berserker Stance|Berserker]] || [[Travel Form|Travel]] (includes [[Aquatic Form|Aquatic]] and [[Flight Form|Flight]] forms) || || || || || |- | Stance 4 || || [[Moonkin Form|Moonkin]]|| || || || |- | Stance 5 || || || || || || || |- | Stance 6 || || || || || || || |} Note: If a Druid is missing a form, all the higher-number ones will be shifted upwards on the chart. Also, Tree of Life does not have the word "Form". If the player is using Glyph of the Stag and/or Tree of Life, this table will not be accurate. Note: If a priest has both Shadowform and Spirit of Redemption, Stance 2 is Spirit of Redemption. Example: /cancelform [noform:1/3] /cast [form:1/3] Faerie Fire (Feral)(); [noform] Faerie Fire In Bear and Cat forms, this will cast Faerie Fire (Feral). In caster form, it will cast Faerie Fire. In any other stance, running the macro will return you to caster form. Note that after patch 2.3, /cancelform will register instantly so it will immediately cast Faerie Fire after leaving a form. ===stealth=== This works like [stance:n] and can be used for any class other than rogues that have a stealth ability, like druid cat form stealth, Night Elves' shadowmeld, etc. It is redundant for rogues because [stance:1] and [stealth] do exactly the same thing for them. ===modifier:shift/ctrl/alt=== Modifier keys are a convenient way to save action bar space and make certain decisions. Say you want an implied targeting macro but use one spell normally and another spell when you're holding down a modifier key: /cast [modifier, help] [modifier, @targettarget, help] Flash Heal; [help] [@targettarget] Greater Heal This macro will cast a helpful spell on either your target if it's friendly, or your target's target otherwise. When you hold any modifier key, it will cast Flash Heal. Otherwise it will cast Greater Heal. For a less complicated example, the following macros all function identically. They will all cast spell A on your target, or spell B if the control key is held: /cast [mod:ctrl] Spell B; Spell A /cast [@target] Spell A; [mod:ctrl, @target] Spell B /cast [nomod] Spell A; [mod:ctrl] Spell B Of course, you can specify particular modifier keys for more control a la [modifier:shift/ctrl] which means "shift or control." If you want to specify both, you need two modifier conditionals: [modifier:shift, modifier:ctrl]. If you want to create a macro with one modifier for spell x and two modifiers, where one is the same as for x, for spell y you have to write the two modifiers first: <code>/cast [modifier:alt, modifier:ctrl, target=focus] Chimera Shot; [modifier:ctrl] Arcane Shot; Steady Shot</code> Beware if you're using keybindings for your macros. If you bind A to a macro with, say, [modifier:shift] and you have something else bound to SHIFT-A, the SHIFT-A binding will take precedence and your macro will not run. The shorter version of this conditional — mod — may be used to save characters in your macro. ====Modifier variables==== While modifier keys can only be one of shift, ctrl, or alt, there are a number of system variables that you can use in your modifier conditions as well. For instance, the SELFCAST variable means "whatever your self-cast modifier is set to." The default is alt (holding the alt key while casting a spell will attempt to cast it on yourself) though some AddOns give you the option to change this. If you create a macro like: /cast [modifier:SELFCAST, @player] [@mouseover] [ ] Greater Heal It will work as expected no matter what you have set as your self-cast key. Some other variables and their defaults (though with arguably much less utility) are as follows: * AUTOLOOTTOGGLE (shift) * STICKYCAMERA (ctrl) * SPLITSTACK (shift) * PICKUPACTION (shift) * COMPAREITEMS (shift) * OPENALLBAGS (shift) * QUESTWATCHTOGGLE (shift) ===button:1/2/.../5/''<virtual click>''=== Similar to [modifier], [button] allows your macro to respond differently based on which mouse button is being used to activate the macro. Button numbers 1-5 correspond to left, right, middle, button 4, and button 5, respectively. If your macro is activated by a keybinding, [button:1] will always be true. As an example, here is the macro you can use for mounting: <nowiki>#show Swift Green Mechanostrider /userandom [nobutton:2, flyable, nomounted] Ebon Gryphon; [nomounted] Black Battlestrider, Swift Green Mechanostrider /dismount [noflying] [button:2]</nowiki> Behavior when not mounted: left-clicking will pick Ebon Gryphon if it can be used (flyable), otherwise it will randomly pick the Black Battlestrider or the Swift Green Mechanostrider. Right-clicking will always pick one of the mechachickens. Behavior when mounted: left-click will only dismount if not flying. Right-click will always dismount. The "virtual click" can usually be ignored, but if you use a bar mod it can be useful. Action bars that respond to various state changes translate clicks to virtual ones that determine which action to use. Because these virtual clicks are AddOn-specific, we won't go into any further detail here. ===equipped:''<item type>''=== [equipped] allows you to determine if a particular type of gear is equipped. The item type can be an inventory slot name, an item type, or an item subtype. See [[ItemType]] and [[InventorySlotName]] for lists of these types. Here is the macro you can use to pick Shield Bash or Pummel depending on what you've got equipped: <nowiki>#show [equipped:Shields] Shield Bash; Pummel /cast [equipped:Shields,stance:1/2] Shield Bash; [equipped:Shields] Defensive Stance; [stance:3] Pummel; Berserker Stance</nowiki><br /> The #show line is used to make it show either Shield Bash or Pummel. Without it, it would show the stance spells as well, when applicable. Here's some pseudocode that illustrates how the second line works: if a shield is equipped and you're in Battle or Defensive stance then /cast Shield Bash else if a shield is equipped then /cast Defensive Stance else if you're in Berserker stance then /cast Pummel else /cast Berserker Stance Here's another macro that lets you cast Overpower with a bit more vigor: /equip [noequipped:Two-Handed Axes] Crystalforged War Axe /cast [nostance:1] Battle Stance; [equipped:Two-Handed Axes] Overpower === channeling:''<spell name>'' === Normally, if you are channeling a spell and begin casting another spell, it will cancel the channel. This option allows you to keep that from happening, and also has a few other uses. For instance, maybe you do want to cancel one particular spell but not another. [channeling] alone matches any spell and you can also list an arbitrary number of spell names to check. Note: channeling is NOT the same as casting. The [channeling] conditional only applies to spells like Arcane Missiles, Drain Life, Mind Flay, etc. where after the initial cast, the spell makes its effect over time. ===actionbar:1/.../6=== The default UI provides a number of action bar pages. These pages only affect the lower left action bar that is visible by default. Luckily, you can make macros that respond to different action bar pages and place them on the other action bars. One example is for a hunter to emulate stances using their aspects: /swapactionbar 1 2 /cast [actionbar:1] Aspect of the Hawk; Aspect of the Monkey This macro will switch between action bars 1 and 2. When it switches to bar 1 it casts Aspect of the Hawk, and when it goes to bar 2 it casts Aspect of the Monkey. ===pet:''<pet name or type>''=== Every class with a pet will find this one useful. It allows you to choose an action based on which pet you have out. You can specify your pet's name or your pet's type (Voidwalker, Boar, Imp, Wolf, etc.). [pet] by itself matches any pet. For example, a Mage can choose between their elemental's Freeze spell or their own Frost Nova: /cast [pet] Freeze; Frost Nova If you are not certain of the pet's type, you can run this command after summoning the pet. Do not use this as part of the macro, only for testing: /script print([[API_UnitCreatureFamily|UnitCreatureFamily]]("pet")) ===combat=== True if you are in combat. ===mounted, swimming, flying, indoors and outdoors=== These are all fairly self-explanatory. They all apply to you, the player. ===flyable=== As briefly mentioned above, [flyable] determines whether you are in the Outland or Northrend where you're allowed to use a flying mount. As of Cataclysm you can use a flying mount in Kalimdor, the Eastern Kingdoms and Deepholm If you have the Cataclysm expansion set and if you are a level 60 and have the Expert Riding skill and the Flight Master's License (info From [http://www.wowhead.com/spell=34090#comments comments on Wowhead] and {{wowplink|Flight Master's License}}) At Patch 3.0.8 it is bugged in Dalaran and Wintergrasp. This zones are reported as flyable, but it is not possible to fly there. As of Patch 3.2, flyable now works as expected in Dalaran and Wintergrasp (except during the battle for Wintergrasp). ===party and raid=== These return true if the target is in your party or raid, respectively. ===group:party/raid=== This lets you determine whether you are in the given group type. [group] is equivalent to [group:party]. [group:raid] implies [group:party]. This can be useful for buffing classes. For example: /cast [group, nomodifier] Arcane Brilliance; [help] [target=player] Arcane Intellect If you're in a group it will normally cast Arcane Brilliance. If you're holding a modifier key or you're solo, it will cast Arcane Intellect on a friendly target or yourself. === talent:<''tier#''>/<''column#''> === Returns true if you have selected the talent from the specified tier (1-7) and column (1-3) combination. Useful if you want to use the same button to cast two (or more) diffrent spells from the same talent tier: /cast [talent:3/1] Call of the Elements; [talent:3/3] Totemic Projection If you have selected Call of the Elements (tier 3 column 1 Shaman talent) the macro will cast it. If you have selected Totemic Projection (tier 3 colmn 3 Shaman Talent), it will be cast instead.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)