General Interest Targeting/Focusing Macro

I believe this is of general interest, transversal to all classes with the proper small adaptations, thus I post here.

I’ve “target nearest enemy” bind to TAB.

I would like to have a macro to bind to the TAB key that would do the following:

  • target the nearest alive enemy
  • target the second nearest alive enemy and place it on “focus”
  • if/as soon as one dies target another alive enemy and put it on queue:
  • target > focus > target > focus rotation

Thank you

I don’t think you can do that with the WoW API. You can set a key to manually target or auto target (targetenemy, startattack) but it only allows you to one target at a time. I think because of how the API is you can only set something once and it has an internal cool down before you can set another target. I’ll have to look at the API code later in the week to confirm, but from what I remember when I was writing addons, that wasn’t allowed.

Good luck.

What I’d like to do is bind the macro (target/focus) to the TAB key (out of convenience for I’m used to that key and it’s keyboard placement is decent) in my particular case using Bartender4.

I never noticed any CD applied either to “target” or “focus”

Thank you

Hello Beresford. It can be difficult to achieve the specific way you mentioned on the first post, if not impossible. Now I can try to replicate that with code but I’m not sure if it would work how you want it.

/cleartarget [dead]
/clearfocus [dead]
/targetenemy [noharm,nodead]
/targetenemy [noharm,nodead]
/focus [noharm,nodead]
/targetlasttarget [noharm,nodead]

Remember this is just me experimenting, hoping that in theory it should work how we want. :slight_smile:

I decided to log to try it and it does not work.

But then I played a bit and was able to get similar results to what you want but in reverse. It will target first target and focus that and then target a different one if is close.

Here is the macro:

/targetenemy [noharm,nodead]
/focus [nodead]
/targetenemy [nodead]
/cleartarget [dead]
/clearfocus [dead]

I hope you like it.

August is long gone and sadly so is my vacation.

September started with the usual “every day war” that was, only now, interrupted by a flu; kindly giving me some time to myself again, although at the price of a headache and red eyes :slight_smile:

Time to thank you properly, Luis; yes it worked!

Many thanks for taking the time to answer, develop and test the little guy, it has made my WoW fingers happy :smiley: