I simply cannot get it to work. don't know why.
Lua Code:
local _settings = {}
local savedVariables
local index = 1
local i = 1
local function GetRaidLeaderboardEntries(index)
local ranking, charName, score, classId, allianceId
local entry
for i = 1, GetNumRaidLeaderboardEntries(index) do
ranking, charName, score, classId, allianceId = GetRaidLeaderboardEntryInfo(index, i)
entry = {
ranking == ranking,
charName == charName,
score == score,
classId == classId,
allianceId == allianceId
}
table.insert(savedVariables,entry)
end
end
local function OnAddonLoaded(event, addonName)
if addonName == "webraid" then --addonName is in general name of your addon manifext without .txt extension
savedVariables = ZO_SavedVars:NewAccountWide("webraid", 1, _settings, nil)
end
end
EVENT_MANAGER:RegisterForEvent("MyAddon_LeaderBoardDataChanged",EVENT_RAID_LEADERBOARD_DATA_CHANGED,function(eventCode)
local leaderboards = GetNumRaidLeaderboards()
savedVariables.leaderboards = leaderboards
d("Leaderboard data saved...")
end)
EVENT_MANAGER:RegisterForEvent("MyAddon_Loaded",EVENT_ADD_ON_LOADED,function(eventCode,name)
if name ~= "webraid" then return end
SLASH_COMMANDS["/leaderboards"] = function()
d("Querying leaderboards...")
d(GetRaidLeaderboardEntryInfo(2, 1))
QueryRaidLeaderboardData()
end
end)
Saved variables just keeps doing weird stuff like this
Lua Code:
webraid =
{
["Default"] =
{
["@Woeler"] =
{
["$AccountWide"] =
{
["version"] = 1,
["@Woeler"] =
{
["$AccountWide"] =
{
["@Woeler"] =
{
["$AccountWide"] =
{
["version"] = 1,
},
["Woeler"] =
{
["@Woeler"] =
{
["Woeler"] =
{
["@Woeler"] =
{
["Woeler"] =
{
["version"] = 1,
},
},
["version"] = 1,
},
},
["version"] = 1,
},
},
["version"] = 1,
},
["Woeler"] =
{
["@Woeler"] =
{
["Woeler"] =
{
["@Woeler"] =
{
["Woeler"] =
{
["version"] = 1,
},
},
["version"] = 1,
},
},
["version"] = 1,
},
},
["entries"] =
{
},
},
["Woeler"] =
{
["@Woeler"] =
{
["Woeler"] =
{
["@Woeler"] =
{
["Woeler"] =
{
["version"] = 1,
},
},
["version"] = 1,
},
},
["version"] = 1,
},
},
},
}