Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API GetStatistic

Last wiki revision 2022-08-01

Returns a character statistic. value, skip, id = GetStatistic(category [, index])

  • category: - AchievementID of a statistic or statistic category.
  • index: - Entry within a statistic category, if applicable.
  • value: - Value of the statistic as displayed in-game.
  • skip: - Prevents a statistic from being shown in the default UI.
  • id: - Unknown.
  • Using the achievementID's of actual Achievements, as opposed to statistics, generates strange results. More testing is needed.
  • Wrapping the returned value with is necessary to do comparisons using math operators.

Here is a function that will take any statistic title (like ) and will return the statistic ID for that statistic, so it can be used in other functions.

function GetStatisticId(StatisticTitle) for _, CategoryId in pairs(GetStatisticsCategoryList) do for i = 1, GetCategoryNumAchievements(CategoryId) do local IDNumber, Name = GetAchievementInfo(CategoryId, i) if Name == StatisticTitle then return IDNumber end end end return -1 end

Source

https://warcraft.wiki.gg/wiki/API_GetStatistic · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.