View Single Post
06/24/15, 04:28 AM   #5
Woeler
 
Woeler's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 40
Guess I'm just a noob, but why do I get nil from the function on line 18, seems like it can't get anything from the leaderboards, but I have no idea why.

Lua Code:
  1. webraid = {}
  2.  
  3. -- Add these lines here:
  4. webraid.Default = {
  5.     OffsetX = 20,
  6.     OffsetY = 75
  7. }
  8.    
  9.  
  10. function getAA()
  11. d("LEaderboard refreshed")
  12. QueryRaidLeaderboardData()
  13. local raidIndex = 1
  14. local ranking, charName, score, classId, allianceId
  15. local i = 1
  16. while i ~= GetNumRaidLeaderboardEntries(raidIndex) do
  17.     ranking, charName, score, classId, allianceId = GetRaidLeaderboardEntryInfo(raidIndex, i)
  18.     SavedVariables.rank[i] = ranking
  19.     SavedVariables.charname[i] = charname
  20.     SavedVariables.score[i] = score
  21.     SavedVariables.allianceId[i] = allianceId
  22.     i = i + 1
  23. end
  24. end
  25.  
  26.     --event handler for EVENT_ADD_ON_LOADED
  27.     local function OnAddonLoaded(event, addonName)
  28.         if addonName == "webraid" then --addonName is in general name of your addon manifext without .txt extension
  29.             d("Webraid loaded")
  30.             EVENT_MANAGER:UnregisterForEvent(MoveHandler, EVENT_ADD_ON_LOADED)
  31.      
  32.             --saved variables (in this case account wide)
  33.             savedVariables = ZO_SavedVars:New("webraid", 1, nil, webraid.Default)
  34.      
  35.  
  36.         end
  37.     end
  38.         EVENT_MANAGER:RegisterForEvent(MoveHandler, EVENT_ADD_ON_LOADED, OnAddonLoaded)
  39.         EVENT_MANAGER:RegisterForEvent(RaidsUpdated, EVENT_RAID_LEADERBOARD_DATA_CHANGED, getAA)
  Reply With Quote