I am trying to get a script working, but I'm running into a couple of issues. The purpose of the script is to display my talent spec on my unit frame, and my target's (player only) spec on their unit frame. Example
The data is good, and the format is right. But my issues are:
1) The script I have is not printing anything on my UF.
2) The script is printing my mouseover's spec on my target's UF
Any pointers, or is #2 "working as intended"?
Code:
text = ""
spec = ""
tree = ""
high = 0
if UnitIsUnit(uid, "player") then
for i=1,GetNumTalentTabs() do
name, _, points, _ = GetTalentTabInfo(i)
if points > high then
tree = name
high = points
end
if i == 2 then
spec = spec .. "/" .. points .. "/"
else
spec = spec .. points
end
end
elseif UnitIsPlayer(uid) then
for i=1,GetNumTalentTabs(true) do
name, _, points, _ = GetTalentTabInfo(i,true)
if points > high then
tree = name
high = points
end
if i == 2 then
spec = spec .. "/" .. points .. "/"
else
spec = spec .. points
end
end
end
text = tree .. "\n" .. spec