target nearest friendly excluding self

target nearest friendly excluding self

by Colezz » Tue Jan 26, 2016 5:55 pm

its possible? atm when i use targetnearestfriendlyplayer it will cycle between me and nearest ally jsut want it to target nearest friend and if theres no other allys about it will stay on that guy no matter if i spam it instead of targeting me .
Colezz
Stone Guard
Stone Guard
 

Re: target nearest friendly excluding self

by Bit » Tue Jan 26, 2016 8:48 pm

Code: Select all
/run TargetNearestFriend() if UnitName('target') == UnitName('player') then TargetNearestFriend() end

Maybe this. Will still target yourself if there's no nearest friend though.
Bit
Sergeant Major
Sergeant Major
 

Re: target nearest friendly excluding self

by Dreez » Tue Jan 26, 2016 8:50 pm

only in a rather ugly way:
Code: Select all
/run TargetNearestFriend()if UnitIsUnit("target", "player") then TargetNearestFriend()end


edit: posted at the same time and essentially the same ;)
Dreez - PvP server
<Endzeit>
User avatar
Dreez
Knight-Lieutenant
Knight-Lieutenant
 

Re: target nearest friendly excluding self

by Colezz » Sat Jan 30, 2016 4:10 pm

wow thatnks it works great guys, now just wondering is it possible to make it exclude hunter and warlock pets and only target the player
Colezz
Stone Guard
Stone Guard
 

Re: target nearest friendly excluding self

by Roadblock » Sun Jan 31, 2016 12:18 pm

Colezz wrote:wow thatnks it works great guys, now just wondering is it possible to make it exclude hunter and warlock pets and only target the player

Maybe this will do the job
Code: Select all
/run local t,u,p,e=TargetNearestFriend,UnitIsUnit,UnitIsPlayer,UnitPlayerControlled;t()if u("target","player")or(e("target")and not p("target"))then t() end
Astaldo @ Nostalrius PvE (Alliance)
Addons I've posted on Forum
User avatar
Roadblock
Senior Sergeant
Senior Sergeant
 


Return to Addons & macros