Hey,
I'm fairly new writing addons. What I'm working on is an addon that shows me the arena max. ratings of my target upon slash command by reading the statistics.
What I have written right now does that but there are several issues. First of all here is my code so far:
Code:
SLASH_BRODIE1 = "/brodie"
function SlashCmdList.BRODIE(msg, editbox)
CanInspect("target")
if (event == "INSPECT_ACHIEVEMENT_READY") then
ClearAchievementComparisonUnit()
end
SetAchievementComparisonUnit("target")
print(GetUnitName("target"), "has a 3s max-rating of", GetComparisonStatistic(595))
end
Issue 1: I need to do /brodie more than once for the value to update for a new target. (Guessing this is due to the new inspect-throttle)
Issue 2: Every time SetAchievementComparisonUnit is called there's a lag in-game wether it's via addon or via /run.
I looked at other addons that do similar things, found mostly tooltip addons, but they too use SetAchievementComparisonUnit so I don't think the function is the problem because I can't imagine they all create a lag when you mouseover someone.
Thanks for any help
Nevo