From cddb0e157f3c3b08e9979b30caa3fd7f3bb67805 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 4 Oct 2024 13:03:20 +0200 Subject: [PATCH] Improve stinky detector to add stinkies to friends list --- FreshShit/StinkyDetector/init.lua | 42 +++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/FreshShit/StinkyDetector/init.lua b/FreshShit/StinkyDetector/init.lua index 99fb244..caac85c 100644 --- a/FreshShit/StinkyDetector/init.lua +++ b/FreshShit/StinkyDetector/init.lua @@ -1,9 +1,17 @@ if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end -if not WeakAurasSaved.Cyka.Stinkies then WeakAurasSaved.Cyka.Stinkies = { - ["Курлык"] = true, - ["Redbulka"] = true, - ["Ловилуну"] = true, -} end +if not WeakAurasSaved.Cyka.Stinkies then + WeakAurasSaved.Cyka.Stinkies = { + ["Redbulka"] = true, + ["Курлык"] = true, + ["Riener"] = true, + ["Unwashed"] = true, + ["Ловилуну"] = true, + ["Korovadura"] = true, + ["Pizdosorkam"] = true, + ["Joule"] = true, + ["Rattenfenger"] = true + } +end aura_env.stinkies = WeakAurasSaved.Cyka.Stinkies -- aura_env.stinkies[UnitName("player")] = true @@ -11,13 +19,27 @@ aura_env.localStinkies = {} ---@param name string aura_env.StinkyDetected = function(name) - if not aura_env.localStinkies[name] then + if not aura_env.localStinkies[name] or aura_env.localStinkies[name] < + GetTime() - 60 then PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master") end aura_env.localStinkies[name] = GetTime() end ---/run WeakAurasSaved.Cyka.Stinkies["Redbulka"] = true ---/run WeakAurasSaved.Cyka.Stinkies["Курлык"] = true ---/run WeakAurasSaved.Cyka.Stinkies["Ловилуну"] = true ---/dump WeakAurasSaved.Cyka.Stinkies \ No newline at end of file +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) + C_Timer.After(1, function() + SetFriendNotes(k, "STINKY") + print("AAAAAAAAAAA") + end) + end +end + +-- /dump WeakAurasSaved.Cyka.Stinkies