From f272766915c6453ac0b53e1affe6b800622200b2 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sun, 13 Oct 2024 23:59:09 +0200 Subject: [PATCH] Make note adding run a second after adding friends To make sure newly added friends are reflected in the friends numbers --- FreshShit/StinkyDetector/init.lua | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/FreshShit/StinkyDetector/init.lua b/FreshShit/StinkyDetector/init.lua index 7722e61..cdd90b6 100644 --- a/FreshShit/StinkyDetector/init.lua +++ b/FreshShit/StinkyDetector/init.lua @@ -6,7 +6,7 @@ WeakAurasSaved.Cyka.Stinkies = { ["Riener"] = true, ["Unwashed"] = true, ["Ловилуну"] = true, - ["Фоська"] = true, -- if she comes here to orgrimmar. then she will be with 1 or 2 friends. they can be killed. but it may be difficult + ["Фоська"] = true, -- if she comes here to orgrimmar. then she will be with 1 or 2 friends. they can be killed. but it may be difficult ["Korovadura"] = true, ["Pizdosorkam"] = true, ["Неонанируй"] = true, @@ -92,20 +92,23 @@ for k, v in pairs(WeakAurasSaved.Cyka.Stinkies) do AddFriend(k) end end -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) +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