Here are some of my macros that I've written. These all work without any addons, such as SuperMacro or the likes, but if you do have SuperMacro installed then the spells will show the correct tooltip information on mouse over, and show the cooldown, which is nice ๐
OBS: All macros are one-liners because blizzard doesnt like line breaks in the code ๐
Helper Macro:
This macro is used to find Spell ID's. Spell ID are use when getting spell cooldowns. I haven't found a better way to do it yet ๐
/run local i = 1; while true do local spellName, spellRank = GetSpellName(i,0); if not spellName then do break end; end; DEFAULT_CHAT_FRAME:AddMessage( spellName .. '(' .. spellRank .. ')' .. ' ' .. i ); i = i + 1; end;
Just click this macro and it will list the ID of every spell in your spellbook. This is used later for other macros. The output should look like this:
You will also need this image to find the correct action bar ID for other macros
ShieldBash, only for Dual Wielders!:
This macro does a lot of things, and therefore requires a lot of setup before it works!:
Checks if you are in combat, checks if you have enough rage (10), and if shieldbash is off cooldown
if all conditions are satisfied you equip your shield, uses shield bash
Then unequips your shield and re-equips your offhand
Here is the macro;
/run local u,p=UseAction,"player";_,d=GetSpellCooldown(46,"spell");if d<2 and UnitMana(p)>9 and UnitAffectingCombat(p) then u(41);u(30);CastSpellByName("Shield Bash");elseif IsEquippedAction(30) then PickupContainerItem(4,3);EquipCursorItem(17);end;
The following need to be setup for this to work!:
Find your ShieldBash ID. Use the Helper-macro from above and replace your ShieldBash ID with the number 46 in GetSpellCooldown(46, "spell")
Bind your mainhand weapon to your UI. Replace 41 in u(41) with your main hand actionbar id
Bind your shield to your UI. Replace 30 in u(30) and IsEquippedAction(30) with your shield actionbar id
Lastly make sure your shield is placed as item number 3 in your final bag. If you want your shield place anywhere else, you need to change the numbers in PickupContainerItem(4,3)
Here is a screenshot of my entire setup:
Overpower Macro:
Goes to battle stance, uses overpower
/run local _,_,inBattle=GetShapeshiftFormInfo(1); if inBattle then CastSpellByName("Overpower"); else CastSpellByName("Battle Stance"); end;
Auto attack + Revenge + Sunder Armor Macro
First tries to use Revenge, then Sunder Armor. Also starts auto attack if it isn't started
Requires you to bind your Attack action to the action bar. Use the image above to find the number where you bound it and replace the number 40, with your number:
/script if not IsCurrentAction(40) then UseAction(40); end; CastSpellByName("Revenge"); CastSpellByName("Sunder Armor");
Auto attack + Heroic Strike
Requires you to bind your Attack action to the action bar. Use the image above to find the number where you bound it and replace the number 40, with your number:
/script if not IsCurrentAction(40) then UseAction(40);end; CastSpellByName("Heroic Strike");
Auto attack + Charge + Defensive stance, if shield is equiped
Requires you to bind your Attack action to the action bar. Use the image above to find the number where you bound auto attack and replace the number 40, with your number:
Requires you to bind your shield to the action bar. Use the image above to find the number where you bound your shield and replace the number 30, with your number:
/run local inCombat=UnitAffectingCombat("player");if not IsCurrentAction(40) then UseAction(40);end; CastSpellByName("Charge"); if inCombat and IsEquippedAction(30) then CastSpellByName("Defensive Stance");end;
Cast Bloodrage + use both trinkets
/script CastSpellByName("Bloodrage"); UseInventoryItem(13); UseInventoryItem(14);
Defensive Stance + Disarm if enough rage (20+)
/run local _,_,inDefensive=GetShapeshiftFormInfo(2); if inDefensive then CastSpellByName("Disarm"); elseif (UnitMana("player")>19 and UnitAffectingCombat("player")) then CastSpellByName("Defensive Stance"); end;