Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API GetStatistic
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} __NOTOC__ Return the value of the requested Statistic. value = GetStatistic(achievementID) == Arguments == * achievementID (number) - The ID of the Achievement == Returns == * value (string) - The value of the requested Statistic. == Details == Using the achievementID's of actual Achievements, as opposed to statistics, generates strange results. More testing is needed. == Example == Here is a function that will take any statistic category (like <code>Battlegrounds</code>) and any statistic title in that category (like <code>Battlegrounds played</code>) and will return the statistic ID for that statistic, so it can be used in other functions. <pre> function GetStatisticId(CategoryTitle, StatisticTitle) local str = "" for _, CategoryId in pairs(GetStatisticsCategoryList()) do local Title, ParentCategoryId, Something Title, ParentCategoryId, Something = GetCategoryInfo(CategoryId) if Title == CategoryTitle then local i local statisticCount = GetCategoryNumAchievements(CategoryId) for i = 1, statisticCount do local IDNumber, Name, Points, Completed, Month, Day, Year, Description, Flags, Image, RewardText IDNumber, Name, Points, Completed, Month, Day, Year, Description, Flags, Image, RewardText = GetAchievementInfo(CategoryId, i) if Name == StatisticTitle then return IDNumber end end end end return -1 end </pre>
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)
Close
Loading editor…