Cleanup and details

This commit is contained in:
2024-10-14 18:27:30 +02:00
parent 0ce3b54169
commit d4673d8f74
4 changed files with 35 additions and 28 deletions

View File

@@ -250,7 +250,7 @@ aura_env.localStinkies = {}
---@param name string
aura_env.StinkyDetected = function(name)
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
GetTime() - aura_env.config.throttle then
GetTime() - aura_env.config.messageThrottle then
local stinky = aura_env.stinkies[name]
Message.QueueNotifyGuild(stinky)
Message.QueueNotifyWhisper(stinky)
@@ -260,34 +260,36 @@ aura_env.StinkyDetected = function(name)
aura_env.localStinkies[name] = GetTime()
end
local friends = {}
local numfriends = GetNumFriends()
for i = 1, numfriends do
local name = GetFriendInfo(i)
friends[name] = true
end
for k, v in pairs(WeakAurasSaved.Cyka.Stinkies) do
if not friends[k] then
AddFriend(k)
end
end
C_Timer.After(1, function()
if aura_env.config.addFriends and not aura_env.config.addFriends2 then
local friends = {}
local numfriends = GetNumFriends()
for i = 1, numfriends do
local name = GetFriendInfo(i)
if WeakAurasSaved.Cyka.Stinkies[name] then
C_Timer.After(1, function()
-- print(name .. " " .. i .. " Stinky!")
SetFriendNotes(i, "STINKY")
end)
else
C_Timer.After(1, function()
-- print(name .. " " .. i .. " Not stinky")
SetFriendNotes(i, "Not stinky?")
end)
friends[name] = true
end
for k, v in pairs(WeakAurasSaved.Cyka.Stinkies) do
if not friends[k] then
AddFriend(k)
end
end
end)
C_Timer.After(1, function()
local numfriends = GetNumFriends()
for i = 1, numfriends do
local name = GetFriendInfo(i)
if WeakAurasSaved.Cyka.Stinkies[name] then
C_Timer.After(1, function()
-- print(name .. " " .. i .. " Stinky!")
SetFriendNotes(i, "STINKY")
end)
else
C_Timer.After(1, function()
-- print(name .. " " .. i .. " Not stinky")
SetFriendNotes(i, "Not stinky?")
end)
end
end
end)
end
--/run WeakAurasSaved.Cyka.Stinkies["Totleta"] = true
-- /dump WeakAurasSaved.Cyka.Stinkies