Page 1 of 1

target nearest friendly excluding self

PostPosted: Tue Jan 26, 2016 5:55 pm
by Colezz
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 .

Re: target nearest friendly excluding self

PostPosted: Tue Jan 26, 2016 8:48 pm
by Bit
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.

Re: target nearest friendly excluding self

PostPosted: Tue Jan 26, 2016 8:50 pm
by Dreez
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 ;)

Re: target nearest friendly excluding self

PostPosted: Sat Jan 30, 2016 4:10 pm
by Colezz
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

Re: target nearest friendly excluding self

PostPosted: Sun Jan 31, 2016 12:18 pm
by Roadblock
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