Macro to allow autounshift only out of combat?

I’m trying to make a macro for my Regrowth. Basically, if I am in combat, I don’t want to the macro to allow me to auto unshift. If I am out of combat, I want it to allow auto unshifting. In practice this means that while I’m in combat, it will only go off if I have a Predatory Swiftness proc but I would still be able to use the button to auto unshift outside of combat to do some quick topoff heals. Here is what I have so far…

#showtooltip Regrowth
/console autounshift 0
/use [@mouseover,help,nodead][@targettarget,help,nodead][@player]Regrowth
/console autounshift 1

I noticed that putting a conditional on /console doesn’t seem to work. If I do
/console [combat]autounshift 0
then the macro simply always allows unshifting. Is there a way to do what I’m trying to do?

EDIT: Figured it out. Here is the finished macro if anyone wants to do something similar.

#showtooltip
/run if InCombatLockdown() then SetCVar("autounshift", 0) end
/use [@mouseover,help,nodead][@targettarget,help,nodead][@player]Regrowth
/console autounshift 1
1 Like

Wrap your code in code tags (</> button in the interface) or the forums turn the quotes into smart quotes and break the macros :wink:

Also, you don’t need to hardcode the tooltip, and doing so prevents the icon from properly range finding on mouseover/targettarget.

#showtooltip
/run if InCombatLockdown() then SetCVar("autounshift", 0) end
/use [@mouseover,help,nodead][help][@targettarget,help,nodead][@player]Regrowth
/console autounshift 1
2 Likes

Thanks! Edited the original post to include the code tags. I didn’t even notice that the showtooltip tag did that when hardcoded!

Yeah, if you don’t hardcode it, it follows the /cast logic. If you hard code it without any conditions then it range finds to your target only.

1 Like