Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement

Disclaimer

This page does not aim at teaching you everything you need to know about macros. It is specificaly aimed at custumising the macros present on the Useful_macros_for_druids page. It assumes you have basic knowledge of how to make macros. To learn how to make your own macros, please refer to the #Resource section.

Coding Basics

Although you might not think of it, the code which makes a macro within world of warcraft is a form of programming. As with any programming, there are a few basic conventions which should be respected in order to yield the desired results. This section aims at teaching you the basics without going into too many details.

Negations

Wrong

/cast [noswimming] !Travel Form; !Aquatic Form

Correct

/cast [swimming] !Aquatic Form; !Travel Form

Both will work, but as your macros get more complex, it will make them harder to read. It is best to state things directly and avoid negations whenever possible.

Extraneous Conditions

Wrong

/cast [swimming] !Aquatic Form; [noswimming] !Travel Form

Correct

/cast [swimming] !Aquatic Form; !Travel Form

While both will work, the noswimming condition is not required. When the first condition is interpreted, if swimming checks to false, then we aready know that we are not swimming. Using a noswimming condition is equivalent to testing weather true = true which we know will always equal to true.

Condition and Spell Order

Wrong

/cast [noswimming, nocombat, noindoors] !Swift Flight Form; [noswimming; noindoors] !Travel Form; [noswimming] !Aquatic Form; !Travel Form; 

Correct

/cast [swimming] !Aquatic Form; [indoors] !Cat Form; [combat][noflyable] !Travel Form; !Swift Flight Form

Notice how heavy the first version is compared to the second version. While both versions will work, the second is easier to read, modify and will also require less processor time to execute. This exemple also has several extraneous conditions and also suffers from abusive use of negations. We check 3 times that we aren't swimming. Such occurances are usualy a sign that the spell cast order and condition order should be reviewed.

There is no set rules as to the order in which conditions and spells should be ordered. The general rule should be that you want your last spell to be the default. Your first spell is determined by your conditions. Your first spell should fit a general condition while each spell down line should fit a more and more specific conditions which is defined by the accumunlation of conditions which tested false.

Notice how Aquatic Form went from the tail end to the start of the macro. We check to see if we are swimming once, and then we know for the rest of the macro that we aren't swimming. Then we check to see if we are indoors and we know for the rest of the macro that we are not indoors. By the time we get to Swift Flight Form, we know that we aren't swimming, aren't indoors, aren't in combat and can fly. It dosen't get much more specific then that!

Druid Macro Syntax

Shapeshift

You may have noticed that most of the macros in the Shapeshift and Travel section all have the same general syntaxic construction. There is no accident to this, they were all adapted from the same basic code. This section aims at explaining the logic behind that code and how to modify it to your likes.

Travel Syntax

#showtooltip
/cancelform [nostance:0,mod:shift]
/stopmacro [mod:shift]
/cast [swimming] !Aquatic Form; [indoors] !Cat Form; [combat][mod:CTRL] !Travel Form; [flyable] !Swift Flight Form; Ground Mount
/dismount [mounted]
  • Line 1: Shows the tooltip when you mouseover the button and hides the macro text.
  • Line 2: Cancels any form you are in when shift is pressed.
  • Line 3: Stops the macro when shift is pressed. We do this in order to avoid having to add nomod:shift to every single condition after this line.
  • Line 4: This is the actual cast line...
    • We test to see if we are swimming first because it is the only in water travel mode we will want to use.
    • We test to see if we are indoors. Both Travel Form and Swift Flight Form can only be used while Outdoors, so we save ourselves 2 conditions.
    • We test to see if we are in combat. While Travel Form is usable in combat, Swift Flight Form is not. We also test to see if CTRL is pressed. This condition serves as an overide for the default behavior of this macro. This would be used when we are carrying the flag in a battleground for exemple.
    • We test to see to see if we can fly.
    • This leaves us with our default, the ground mount. By now, we know that we are not swimming, not indoors, not in combat and can't fly.
  • Line 5: Dismounts you when you are mounted.

Powershift

You may have noticed the ! before every form in the travel macro. By default, when you cast a form, the UI will take you to that form. The next cast will take you out of form. The ! forces a recast of the form without going to caster. This is usefull to clear snares or roots depending on your spec.

References

Stance Numbers 4.0.6

Many druid macros make use of the stance modifier to detect which form you are in. The stance numbers each refer to a Form. Be aware that Ability druid flightform [Flight Form] or Ability druid flightform [Swift Flight Form] will be either stance 5 or 6 depending on the availability of Spell nature forceofnature [Moonkin Form] and Tree of Life (druid ability).

Stance Number Form Notes
Stance 0 Caster Default Stance, never changes
Stance 1 Ability racial bearform [Bear Form] never changes
Stance 2 Ability druid aquaticform [Aquatic Form] never changes
Stance 3 Ability druid catform [Cat Form] never changes
Stance 4 Ability druid travelform [Travel Form] never changes
Stance 5 Spell nature forceofnature [Moonkin Form] or Tree of Life (druid ability) When available, they are stance 5.
Stance 5 or 6 Ability druid flightform [Flight Form] or Ability druid flightform [Swift Flight Form] If Spell nature forceofnature [Moonkin Form] or Tree of Life (druid ability) is available, theses are stance 6. Otherwise, they will be stance 5.

Other Resources

Audible Errors

Some macros may generate audible errors such as "Target not in Range". You can either turn off Error Speech in your Sound & Voice settings, or add the following lines at the beginning and end of the offending macro.

/console Sound_EnableSFX 0
/console Sound_EnableSFX 1

Trinkets 4.0.6

Add theses lines at the end of your macro to activate a trinket. 13 is the top trinket slot, 14 is the bottom slots. For any other equipment or inventory slot, refer to InventorySlotId

/use 13
/use 14

Raid Targets

The following command will set a skull raid target.

Note

  • The number 8 in this line refers to the skull. Refer to Raid_target_icons for the ID of other raid targets.
  • Target can be replaced with any valid unit ID. Refer to UnitId for other valid unit IDs.
/script SetRaidTarget("target",8)

Swapping action bars

Nowadays, with action bar mods, it is fully possible to have very fine control of action bar paging. However, some might still wish to do so the old fashion way in their macros. Should this be your case, this line will allow you to do that. Change the numbers to the bars you wish to swap.

/swapactionbar 1 2
Advertisement