Implement friend tracker

This commit is contained in:
2024-10-14 21:01:09 +02:00
parent ed4d8752a8
commit 7754276985
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
-- FRIENDLIST_UPDATE
function(e)
-- Event triggered by ShowFriends()
aura_env.FileFriends()
end

View File

@@ -0,0 +1,19 @@
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
if not WeakAurasSaved.Cyka.Friends then WeakAurasSaved.Cyka.Friends = {} end
aura_env.FileFriends = function()
local info = {}
local now = date("%y-%m-%dT%H:%M:%S")
local friends = GetNumFriends()
for i = 1, friends do
local name, level, class, area, connected, status, note, noteType = GetFriendInfo(i)
table.insert(info, {
["name"] = name,
["connected"] = connected,
["area"] = area,
["status"] = status,
})
end
DevTools_Dump(info)
WeakAurasSaved.Cyka.Friends[now] = info
end