I've tried to find this little block of code everywhere, but without luck.
What I want it to do is something similar to the following:
if target = player (me) display (insert text -ex. "you")
else display none
Is this even possible?
If so, how?
Can't tell exactly the answer, too long w/o practice, but you can look at TipTac addon, it surely has the "<<<You>>>" string in tooltip when someone is targeting you
Where? In the tooltip? Need more info.
The basic code is as follows:
Code:if UnitIsUnit("player", "target") then -- do stuff end
I know you didn't want the "else" section to not display anything, but this will explicitly print out "none" so you can learn how it's done:
This one only prints out when you're your own target:Code:/run if GetUnitName("player") == GetUnitName("target") then print("you") else print("none") end
edit: meh, the master replied before me, and his is more streamlinedCode:/run if GetUnitName("player") == GetUnitName("target") then print("you") end
- It was actually for Pitbull. So instead of the target's target's name, then it would be blank, or say "you" instead if I was the target.
Thanks a bunch, all of you.
Got it to work with this:
Fiddled around with it a bit to make it print stuff in the chatlog and there's definitely room for some more practice (fun) there.Code:if UnitIsUnit("player", "target") then return ("you") end
Thanks again guys.