Looking for a counterspell macro

So far I have cast on focus target and on main target when no focus target. Is there a way to make counterspell cast on main target when they’re casting if the focus target isn’t casting? And also cast on focus target if they’re both casting. If there is a macro for this and you know it, would you plz include cast on main target when no focus target?

Generally, if-then-else logic such as you want isn’t supported by the macro language as it becomes automation which can get an account banned.

Macro’s can’t make decisions based on stuff like if an enemy is casting, if something is on cooldown, or based on buffs/debuffs.

Probably your best bet is to add a modifier key to let you override the normal logic of the macro. For example:

#showtooltip
/cast [mod:shift,harm,nodead][@focus,harm,nodead][]Counterspell

That will cast on the focus if you’ve got one (and it’s alive and an enemy) or your target if you don’t. However, if you are holding shift, it will cast on your target, even if you have a focus.

2 Likes

Very cool that’s actually better. But now I’m wondering, I keep my counterspell under alt 2, and I have number keys set to shift as well, how can I work it in with this? For example if I set it to c instead of shift, will alt+c+2 cast correctly on my target? Ty btw

You can’t use two non-modifier keys together to cast spells. You can use multiple modifier keys, though. You can replace the mod:shift with mod:ctrl if you aren’t using control for anything. (Then, casting alt+ctrl+2 would get the desired results — assuming no other keybinding conflicts.)

It’s pretty common for people who use lots of macros to avoid using modifier keys in their actual keybinds to avoid such conflicts. You can still macro stuff up to use the modifiers for different abilities.

1 Like

It works! Coo