Macro Chaining 101/102 (Focus on Beast Mastery Hunters)
I built these for myself using the Action Bar handlers in ElvUI and ElvUI_ExtraActionBars. Bartender will work as well, but don’t ask me specific questions related to Bartender as I don’t use it. I suspect Domino will work, but I don’t have that either. You can do this with the Vanilla UI, but it’s . . . awkward . . . at best. I strongly recommend a bar mod that allows you to access all 120 action slots directly.
Assumptions:
- You have a bar of buttons you can set aside for macros executed indirectly.
- That bar cannot be a “paging” bar.
- That bar does not have to be visible (at least in ElvUI).
- In 5-man content ONLY, you will assign your Tank as your Focus Unit.
- Somewhere upstream from executing these macros (preferably a startup macro) you run this code:
SetCVar("TargetNearestUseNew" , 0,"scriptCVar")
SetCVar("stopAutoAttackOnTargetChange", 1,"scriptCVar")
Conventions:
- I’m going to use my button names.
- You’ll need to identify what buttons you want to use based on your own UI.
- Discover their formal names, the button frame names, using /framestack or /fstack.
- When you’re one with /framestack, type it again to make it to away.
Target Control
- Requires you to set aside six buttons.
- Applies to only unit targeted, DPS actions.
- Allows for situational targeting priority plug-ins.
Name: Tgt Atk 1
Desc: Dismounts on mod and dispatches to the rest of the chain.
Button: ElvUI_Bar6Button1
Icon: <any, but the automatic one won’t work well>
/dismount [mounted,mod]
/leavevehicle [vehicleui,mod]
/click ElvUI_Bar5Button2
/click ElvUI_Bar5Button3
/click ElvUI_Bar5Button4
/click ElvUI_Bar5Button5
/click ElvUI_Bar5Button6
Name: Tgt Atk 2
Desc: Sets targeting priority to PVP or PVE based on whether or not you know the second of your PVP talents (the first might be Honorable Medallion which always comes up true).
Button: ElvUI_Bar6Button2
Icon: <any, but the automatic one won’t work well>
/stopmacro [combat]
/run local C,I,S,N="TargetPriorityPvp",select(6,GetPvpTalentInfoByID((C_SpecializationInfo.GetAllSelectedPvpTalentIDs()[2])))S=((I and IsPlayerSpell(I)and"3")or"2")if not(GetCVar(C)==S)then SetCVar(C,tonumber(S),"scriptCVar")end
Caveat: I do this in a startup macro and I haven’t tested this version. It might error out. If so, look to the addendum at the end of this post for my full code and adjust as needed.
Name: Tgt Atk 3 (OPTIONAL)
Desc: Allows for inserting situational priority target units. This bypasses the normal targeting process by forcing in the highest priority target from the target list (if there are any).
Button: ElvUI_Bar6Button3
Icon: <any, but the automatic one won’t work well>
/targetexact \<sixth highest priority situational target unit\>
/targetexact \<fifth highest priority situational target unit\>
/targetexact \<fourth highest priority situational target unit\>
/targetexact \<third highest priority situational target unit\>
/targetexact \<second highest priority situational target unit\>
/targetexact \<highest priority situational target unit\>
Insert or delete as needed. Be careful to drag this macro off its button as soon as it’s no longer needed or you might run into problems.
Name: Tgt Atk 4
Desc: Default target selection with pet optimization.
Button: ElvUI_Bar6Button4
Icon: <any, but the automatic one won’t work well>
/petstay [dead][noharm][mod:ctrl]
/cleartarget [dead][noharm][mod:ctrl]
/tar [@mouseover,harm,nodead,mod:shift]
/targetenemy [noharm][noexists]
Name: Tgt Atk 5
Desc: Aggro and pet taunt management. This will cast Misdirection on your Focus unit if it lives, is not mind-controlled or charmed, and you’re not in a Raid, otherwise it will cast Misdirection on your pet. It will shut off Growl autocast if you are in a Raid or if you are in a 5-man with a living, helpable Tank, otherwise, it will turn on Growl autocast (in 5-man it will put your pet in auto-tanking mode if the tank dies, is mind-controlled, or is charmed and will stop as soon as that situation no longer exists).
Button: ElvUI_Bar6Button5
Icon: Automatic (the “?” icon)
#show Misdirection
/cast [nogroup:raid,group,@focus,help,nodead][@pet,exists,nodead]Misdirection
/petautocastoff [group:raid][group,@focus,help,nodead]Growl
/stopmacro [group:raid][group,@focus,help,nodead]
/petautocaston Growl
Name: Tgt Atk 6
Desc: Ensures your pet’s stances and basic command is compatible with a targeted attack. Bypasses the flawed pet autoattack timers.
Button: ElvUI_Bar6Button6
Icon: <any, but the automatic one won’t work well>
#show
/petassist
/petattack
/use [harm,nodead]Claw
/use [harm,nodead]Bite
/use [harm,nodead]Smack
Usage:
Using Cobra shot as an example, you’d set up your attack macro like this…
#show Cobra Shot
/click ElvUI_Bar6Button1
/cast [harm,nodead]Cobra Shot
Each of your unit targeted attacks (Barbed Shot, Chimaera Shot, A Murder of Crows, etc.) should be structured like this.
I’ve got another section I want to do on pet management, but it’s late and I’ll need to add that tomorrow.
Addendum
In my startup addon, I have a slash command processor that uses “mao” as the command name.
This command…
/mao pvppve
…invokes this code:
local function DoSlashCmd(A)
local L = {
strsplit(" ", (strlower((strtrim((gsub((A or ""), "%s+", " ")))))))
}
if L[1] == "pvppve" then
local pvpPriorityCVarString = "2"
for k, v in ipairs(C_SpecializationInfo.GetAllSelectedPvpTalentIDs()) do
local pvpTalentSpellID = select(6, GetPvpTalentInfoByID(v))
if k > 1 and pvpTalentSpellID and IsPlayerSpell(pvpTalentSpellID) then
pvpPriorityCVarString = "3"
break
end
end
local pvpPriorityCVarNumber = tonumber(pvpPriorityCVarString)
if (GetCVar("TargetPriorityPvp") == pvpPriorityCVarString) then
else
if InCombatLockdown() then
else
SetCVar("TargetPriorityPvp", pvpPriorityCVarNumber, "scriptCVar")
end
end
end
end
I have a lot more subcommands available to me and I stripped this down to its bones for clarity. It’s possible I introduced a code error when I did that, but I was pretty careful.