WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Focusing current target based on name (https://www.wowinterface.com/forums/showthread.php?t=54306)

RaxleMF 08-27-16 02:19 AM

Focusing current target based on name
 
I've been trying to figure out how to have a macro that will set my target as my focus, but only if it's my Soul Effigy (Warlock Level 100 talent).

The idea is that I tie this event in with my Agony button so that when I cast Agony, it will also automatically focus the target if it's my Soul Effigy. Something along the lines of:

#showtooltip
/cast [mod:alt,@focus][] Agony
/run local (Insert script here)

The script would check if my current target's name is Soul Effigy, and if so, set it as my focus.

Thanks in advance for any and all help!

Phanx 08-27-16 03:06 AM

/cleartarget
/targetexact Soul Effigy
/focus [exists]
/targetlasttarget


Leave off the last line if you want to keep targeting your Soul Effigy afterward, or replace it with another /cleartarget if you want to end up not targeting anything.

RaxleMF 08-27-16 11:16 AM

Thanks for the suggestion!

I had this thought too, except I didn't think of starting with /cleartarget, which fixes the issue I had. This would redundantly focus my Effigy every time I hit my Agony button, but I suppose there's no harm in it as long as I keep the /targetlasttarget at the end.

Edit: So the macro you suggested didn't work exactly as I had hoped, but I tweaked it a bit and now it's perfect. For reference, here's what I ended up with:

#showtooltip
/cast [mod:alt,@focus][] Agony
/stopmacro [@focus,exists]
/cleartarget
/targetexact Soul Effigy
/focus [exists]
/targetlasttarget [noexists]

This will just cast Agony as normal if my Soul Effigy isn't out. If it's out, it will swap to it and focus it if I don't have a focus already. With the original, I had some issues with my target dropping when I didn't want it to if my Soul Effigy was out and focused.


All times are GMT -6. The time now is 12:13 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI