Hello all!
I recently set up an addon to modify my trap macro, allowing me to hold down the keybind to see the reticle, then release to drop it on the cursor. Normally I’d leave this kind of thing over in the UI & Macro forums, but I have found it to be insanely useful so cross posting here.
For Hunters, this works with:
- Freezing Trap
- Tar Trap
- Flare
- Eagle Eye
- Binding Shot
- Volley
- Steel Trap
- Hi-Explosive Trap
- Dire Beast: Hawk
- Wild Spirits
- Resonating Arrow
- Door of Shadows
It works with any ground-target ability/item/toy you might want to keybind, with the exception of PetMoveTo (since that isn’t an ability but a pet command).
--Trap On Release
local key = "PageDown"
if select(2,UnitClass("player"))=="HUNTER" then
local FreezingTrapOnUp = CreateFrame("Button","FreezingTrapOnUp",nil,"SecureActionButtonTemplate")
FreezingTrapOnUp:RegisterForClicks("AnyDown","AnyUp")
FreezingTrapOnUp:SetAttribute("type","macro")
SecureHandlerWrapScript(FreezingTrapOnUp,"OnClick",FreezingTrapOnUp,[[
if down then
self:SetAttribute("macrotext","/cast Freezing Trap")
else
self:SetAttribute("macrotext","/stopspelltarget\n/cast [@cursor] Freezing Trap")
end
]])
FreezingTrapOnUp:RegisterEvent("PLAYER_LOGIN")
FreezingTrapOnUp:SetScript("OnEvent",function(self,event,...)
SetOverrideBindingClick(self,true,key,"FreezingTrapOnUp")
end)
end
This example is for Freezing Trap, using Page Down. You can change it to any other ability by changing all instances of Freezing Trap
or FreezingTrapOnUp
to reflect the ability you want instead. You can change the keybind by changing key=PageDown
to whatever binding you prefer.
You can duplicate this for multiple abilities if you like (I currently use it for Freezing Trap, Tar Trap, and Binding Shot), but be aware you will also need to update key
to key1
key2
key3
etc if you are doing more than one.
Copy this code into https://addon.bool.no/ to create a mini addon that will set the keybinding for you. In my example, I have the binding set to PageDown. It will supercede (but not overwrite) your existing binds, so if you disable the addon, the keybind will work as normal.
For my personal use, I have long used this macro, keybound to PageDown (my mouse drivers have Mouse6 set to PageDown):
#showtooltip
/use [mod:shiftalt,@player][mod:shift,@cursor]Binding Shot;[mod:ctrlalt,@player][mod:ctrl,@cursor]Tar Trap;[mod:alt,@player][@cursor]Freezing Trap
So my version of the addon incorporates all three ground target CCs, using the same modifiers, with an additional [mod:alt,@player]
if I want to drop it at my feet:
--Trap On Release
local key = "PageDown"
if select(2,UnitClass("player"))=="HUNTER" then
local FreezingTrapOnUp = CreateFrame("Button","FreezingTrapOnUp",nil,"SecureActionButtonTemplate")
FreezingTrapOnUp:RegisterForClicks("AnyDown","AnyUp")
FreezingTrapOnUp:SetAttribute("type","macro")
SecureHandlerWrapScript(FreezingTrapOnUp,"OnClick",FreezingTrapOnUp,[[
if down then
self:SetAttribute("macrotext","/cast [@player,mod:alt][]Freezing Trap")
else
self:SetAttribute("macrotext","/stopspelltarget\n/cast [@cursor] Freezing Trap")
end
]])
FreezingTrapOnUp:RegisterEvent("PLAYER_LOGIN")
FreezingTrapOnUp:SetScript("OnEvent",function(self,event,...)
SetOverrideBindingClick(self,true,key,"FreezingTrapOnUp")
end)
end
local key2 = "CTRL-PageDown"
if select(2,UnitClass("player"))=="HUNTER" then
local TarTrapOnUp = CreateFrame("Button","TarTrapOnUp",nil,"SecureActionButtonTemplate")
TarTrapOnUp:RegisterForClicks("AnyDown","AnyUp")
TarTrapOnUp:SetAttribute("type","macro")
SecureHandlerWrapScript(TarTrapOnUp,"OnClick",TarTrapOnUp,[[
if down then
self:SetAttribute("macrotext","/cast [@player,mod:alt][]Tar Trap")
else
self:SetAttribute("macrotext","/stopspelltarget\n/cast [@cursor] Tar Trap")
end
]])
TarTrapOnUp:RegisterEvent("PLAYER_LOGIN")
TarTrapOnUp:SetScript("OnEvent",function(self,event,...)
SetOverrideBindingClick(self,true,key2,"TarTrapOnUp")
end)
end
local key3 = "SHIFT-PageDown"
if select(2,UnitClass("player"))=="HUNTER" then
local BindingShotOnUp = CreateFrame("Button","BindingShotOnUp",nil,"SecureActionButtonTemplate")
BindingShotOnUp:RegisterForClicks("AnyDown","AnyUp")
BindingShotOnUp:SetAttribute("type","macro")
SecureHandlerWrapScript(BindingShotOnUp,"OnClick",BindingShotOnUp,[[
if down then
self:SetAttribute("macrotext","/cast [@player,mod:alt][]Binding Shot")
else
self:SetAttribute("macrotext","/stopspelltarget\n/cast [@cursor] Binding Shot")
end
]])
BindingShotOnUp:RegisterEvent("PLAYER_LOGIN")
BindingShotOnUp:SetScript("OnEvent",function(self,event,...)
SetOverrideBindingClick(self,true,key3,"BindingShotOnUp")
end)
end
I’m able to trap with the speed of an [@cursor]
macro and the precision gained by seeing the reticle. I’ve tested in raids and M+ and it works flawlessly. I’ve tested disabling the addon and my regular macro works exactly the same as it always has, without any need to change keybinds in game.
Let me know if you have any questions or need help setting it up for a specific ability or situation.