View Single Post
04/02/15, 02:16 PM   #4
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 578
That's using offical API functions:
Lua Code:
  1. local function GetAll()
  2.   local function GetAchievements(topLevelIndex, categoryIndex, numAchievements)
  3.     for achievementIndex=1,numAchievements do
  4.       local achievementId = GetAchievementId(topLevelIndex, categoryIndex, achievementIndex)
  5.       local _, _, _, _, completed = GetAchievementInfo(achievementId)
  6.       while achievementId ~= 0 do
  7.         d(achievementId)
  8.         achievementId = GetNextAchievementInLine(achievementId)
  9.       end
  10.     end
  11.   end
  12.  
  13.   local numCategories = GetNumAchievementCategories()
  14.   for topLevelIndex=1,numCategories do
  15.     local _, numSubCatgories, numAchievements = GetAchievementCategoryInfo(topLevelIndex)
  16.     GetAchievements(topLevelIndex, nil, numAchievements) -- General
  17.     for subCategoryIndex=1,numSubCatgories do
  18.       local _, numAchievements = GetAchievementSubCategoryInfo(topLevelIndex, subCategoryIndex)
  19.       GetAchievements(topLevelIndex, subCategoryIndex, numAchievements)
  20.     end
  21.   end
  22. end
But you can probe the ids with local name = GetAchievementInfo(id) until name is nil.

Originally Posted by hisdad View Post
Thx Votan,
It works with the problem that no matter how many I want (9999) it returns a max of 10.
Is there a better way of doing this?

--Dad
  Reply With Quote