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.
Extraneous Conditions
Wrong
/cast [swimming] !Aquatic Form; [noswimming] !Travel Form
Correct
/cast [swimming] !Aquatic Form; !Travel Form
While this 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.
References
Stance Number Variations 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 [Flight Form] or [Swift Flight Form] will be either stance 5 or 6 depending on the availability of [Moonkin Form] and Tree of Life (druid ability).
Stance Number | Form | Notes |
---|---|---|
Stance 0 | Caster | Default Stance, never changes |
Stance 1 | [Bear Form] | never changes |
Stance 2 | [Aquatic Form] | never changes |
Stance 3 | [Cat Form] | never changes |
Stance 4 | [Travel Form] | never changes |
Stance 5 | [Moonkin Form] or Tree of Life (druid ability) | When available, they are stance 5. |
Stance 5 or 6 | [Flight Form] or [Swift Flight Form] | If [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