Looking for a Focus Target Macro

Hi folks. Looking for help creating a macro that will use an ability on my Focus target if it exists, or just the following mouseover if (the focus target) doesn’t exist.

Would it work like this? Or do I need to have this on one line?

/cast [@focustarget,exists][] Blind
/cast [target=mouseover,exists][] Blind

That macro should work, but it’s generally better to condense conditionals together on one line to save space. (And can sometimes prevent weirdness since all lines are supposed to be executed simultaneously. In reality, the tend to go in order from top to bottom so you get away with different lines, but keeping them on one line keeps the order of checks unambiguous.) I’d also use “harm” instead of “exists” for spells that can only be cast on a hostile target, or you’ll get an error if your focus’s target or mouseover are friendly. (Harm implies exists, so you don’t need exists if you use the help or harm conditionals.)

You can also use “@mouseover” in place of target=mousover. The “@” can replace “target=” for any targeting conditionals.

/cast [@focustarget, harm][@mouseover,harm][]Blind

As a warning, @focustarget will cast it on the target of your focus, not on your focus. If you want it to cast on your focus, that would be “@focus”.

4 Likes

That was perfect. Thank you!

1 Like

The issue with your original macro was the [] on each line. That empty option block tells the game to cast the spell as if you’re casting it from the spellbook, so it never reached the 2nd line of the macro.

3 Likes

Thank you. I like learning about this. Shall keep it in mind.

I would also recommend swapping mouseover with the focus target as that would give priority to who you’re mousing over. The conditionals resolve left to right.

/cast [@mouseover, harm][@focustarget,harm][]Blind

3 Likes

Thank you, that might be even better. I also noticed that I’m trying to get it to work as normal when I’m in the middle of action.

E.g. In pvp I move/turn using my right click for speed and on occasion my blind target needs to simply be the person I’m targeting. But it keeps trying to find the focus target.

You should read the sticky here: Macros: Essential Information