Macros: Essential Information

You can’t cast an ability at the nearest enemy target without targeting it. Spells can only be cast at a valid unit, like target, target, focus, focustarget, etc.

You could do this:

#showtooltip
/targetnearestenemy [noharm]
/use [harm][@targettarget,harm][]Crusader Strike
/targetlasttarget [harm]

That will make the nearest enemy your target if and only if you don’t have an enemy targeted. If you have a friendly targeted, it will swap you back to that friendly after Crusader Strike fires.

Note that /targetnearestenemy is the same as tab targeting, so it may or may not target the enemy you want. It can grab somebody out of range rather than the melee beating your face in, for example.

Also note that the macro has no way to know whether /targetnearestenemy fired, or if it successfully picked a target, so you will likely see some unintended behavior from /targetlasttarget from time to time. For example, if you had recently targeted yourself, then manually targeted the enemy, the /targetlasttarget will swap your target back to yourself.

You might try this instead:

#showtooltip
/use [@mouseover,harm,nodead][harm][@targettarget,harm][]Crusader Strike

If you have yourself or a friendly (without a valid enemy target) targeted, you can mouseover the nearest enemy in melee range and still use CS to get your HP.

2 Likes