Target enemy player if exist...

95 Night Elf Priest
4935
I've looked over the forums and searched a couple sites, and maybe I'm just being daft but I can't find definitive information on a macro I'm trying to make.

I've got this:
/targetenemyplayer [exist]
/targetenemy

In theory, it's suppose to prioritize targeting of an enemy player if one is present. If one is not, it should target a hostile NPC.
Scenario 1: Being attacked by a hunter, this should target the hunter and not the hunter's pet.
Scenario 2: Being attacked by a Murloc. This should target the Murloc since no enemy players are near.
In the key-bindings they have either Target enemy player OR Target enemy. Can we consolidate these into one with the priority on the player?

If not, is there a simple, lightweight addon that can do this? It also needs to work for World PvP, not something that just activates in arena or Battlegrounds (I'm looking at you, Gladius).

Many many thanks for any help, and sorry again if this has already been covered.
And yes, I'm wearing the cliche avatar set like all the other priest...
Reply Quote
100 Blood Elf Warlock
19315
I haven't really tested it very well, but perhaps something like this would do what you want:

/targetenemyplayer
/targetenemy [noexist]
Reply Quote
I've looked over the forums and searched a couple sites, and maybe I'm just being daft but I can't find definitive information on a macro I'm trying to make.

I've got this:
/targetenemyplayer [exist]
/targetenemy

In theory, it's suppose to prioritize targeting of an enemy player if one is present. If one is not, it should target a hostile NPC.


No....

1) exist isn't a valid condition. It's exists.
2) it doesn't even work that way, even if you did get the condition right. Conditions act on your current target not the one you're trying to acquire.

Assuming you spelled the condition right, you just told it to target a hostile player if you currently have a target, then target any hostile, which will of course change your target.

Try this
/targetenemyplayer
/targetenemy [noharm][dead]

Target the nearest hostile player
Target the nearest hostile anything IF
- my current target is not hostile (friendly or you don't have a target) ELSE
- my current target is dead.

http://www.wowpedia.org/Making_a_macro
http://www.macroexplain.com/
Reply Quote
95 Night Elf Priest
4935
Thank you both for helping me, I'll try it out. Hope it works, either way thanks again!
Reply Quote
Thanks for the work on this, I was looking for the exact same thing. It seems to work well if you make a couple of small changes:

/cleartarget
/targetenemyplayer[exists]
/targetenemy[noharm][dead]

Thanks again.
Edited by Shotzy on 7/7/2013 3:15 AM PDT
Reply Quote
Thanks for the work on this, I was looking for the exact same thing. It seems to work well if you make a couple of small changes:

/cleartarget
/targetenemyplayer[exists]
/targetenemy[noharm][dead]

Thanks again.


Your second line is completely useless...

First line: unconditionally clears your current target.
Second line: attempt to target an enemy player if your current target exists. Your current target will never exist because you cleared it on the prior line... As such this command will never fire. You could delete it entirely and the macro will behave exactly the same.

Remove the [exists] condition from /targetenemyplayer. With that gone:

First line: unconditionally clears your current target.
Second line: attempt to target an enemy player
Third line: attempt to target any enemy unit IF
- Your current target is not hostile (either friendly, or doesn't exist) This will occur if the previous command failed to aquire a hostile player target. ELSE
- Your current target is dead. This will only occur if the prior command found a dead player (very rare as the cycling target commands are designed to prefer a live target if there's is any within its working range).

http://www.wowpedia.org/Making_a_macro
http://www.macroexplain.com/
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)

Reported!

[Close]