I’ve been trying and failing to make a macro that does the following things:
• Display Wind Shear icon if I have an enemy target OR Cleanse Spirit icon if I have an ally target or no target.
• Cast Wind Shear on my current enemy focus if I have one;
• Cast Wind Shear on my current enemy target if I don’t have a focus;
• Cast Cleanse Spirit on my current ally target, even if I have an enemy focus;
• Cast Cleanse Spirit on me if I don’t have any target, even if I have an enemy focus.
I’ve managed to do some of these, but never all of those together. The closest I got was to have the icon show correctly, along with casting Wind Shear on enemy target, or Cleanse Spirit on ally target, but it didn’t work for focus or without targets.
Can someone help me or give me some macro guide I can follow to create this?
The way WoW evaluates a line is left to right where the first “true” situation get’s used without looking at the rest of the line. The priority list you have doesn’t translate well to a macro. That part of “no target” ignore focus and cast on self is an issue because the target check and “cast self” conflict even if you turn on autoself cast. If you try to stick the “@player” in 1 spot of the cast statement, it will prevent wind shear from being cast completely, and if you stick it in a different spot on the /cast line, it will work partially but not exactly like you want.
You can use [harm] and [help] to differentiate between foe and friend and they include “exists”.
If you hold down a modifier key (alt, shift, ctrl – whatever is NOT keybound to something) it will cast cleanse spirit on you always. Otherwise it will follow this priority sequence:
cast cleanse sprit on friendly, living target
if no friendly living target, cast wind shear on living enemy focus
if no enemy focus, cast wind shear on living enemy target
if no enemy target, just cast cleanse spirit on you
I managed to do everything you want except cast Cleanse Spirit on yourself because of the way the “@” conditionals work. If I try to specify Cleanse Spirit “@player”, I don’t know if there’s a way to check whether or not you have a target because the “exists” conditional corresponds to the “@” unit which is “player”. And because you’ve specified that you want your focus to be prioritized over your enemy target, that command has to be run before the one that checks the status of your target.
Long story short, this does most of it, but I don’t think it’s possible to do all of it:
Rewriting your order of operations into the order you want it to execute in:
Cast Cleanse Spirit on my current ally target
Cast Cleanse Spirit on me if I don’t have any target - You can’t test against a different unit than the one you’re attempting to cast on. Also,@playeralways exists therefore the macro will never advance past this point.
Cast Wind Shear on my current enemy focus if I have one
Cast Wind Shear on my current enemy target
In general for help/harm macros you’ll want to use this as your starting point:
TLDR: Tink’s macro is as close as you can get to desired behavior. Personally I’d drop the nodead from the non-focus condition sets; you’ve gone out of your way to target them, if they’re dead let it error rather than casting on a random target, especially for a critical ability with a CD like Cleanse Spirit.
I’ll definitely be testing all the suggested options. It’s fine if something I wanted to do it not possible, or if the macro needs to be written in a different order. In the case of casting on myself if no target, if that’s not possible, it’s not a HUGE problem, as most of the time I’ll target myself on the raid interface when I need to… and with the conditions I specified, I’d need to drop an enemy target or target myself to dispel when I’m solo anyway.
I’ll see what gets the closest to what I need and I’ll share the results of testing once I try it.