Files
wow-weakauras/FreshShit/StinkyDetector/init.lua

106 lines
3.4 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
WeakAurasSaved.Cyka.Stinkies = {
["Redbulka"] = true,
["Курлык"] = true,
["Riener"] = true,
["Unwashed"] = true,
["Ловилуну"] = true,
["Korovadura"] = true,
["Pizdosorkam"] = true,
["Joule"] = true,
["Rattenfenger"] = true,
["Асталабиста"] = true,
["Srakonyh"] = false, -- Agreed to leave him alone until he kills someone again
["Залупотряс"] = false, -- Муркот: I understand if one of them killed the newbies. then you did everything right. they seem friendly but I also warned them not to hit the newbies
["Чмодвенк"] = false, -- Муркот: I understand if one of them killed the newbies. then you did everything right. they seem friendly but I also warned them not to hit the newbies
["Totleta"] = nil,
}
local toNotify = { "Succpotato", "Extazyk", "Smokefire", "Smokemantra", "Хихихантер", "Муркот", "Растафаркрай" }
-- local toNotify = { "Succpotato" }
aura_env.whisperQueue = {}
aura_env.alliancettl = 120
aura_env.alliance = {}
aura_env.CleanAlliance = function()
for k, v in pairs(aura_env.alliance) do
if v < GetTime() - aura_env.alliancettl then
aura_env.alliance[k] = nil
end
end
end
aura_env.RegisterAlly = function(name)
-- print("Spotted ally: " .. name)
aura_env.alliance[name] = GetTime()
end
local killSpamTime = 30
local recentlyKilled = {}
aura_env.RegisterKill = function(source, destination, spellName, overkill)
if not overkill or overkill <= 0 then
print("No overkill, 'death' not reported (probably not dead...)")
return
end
if recentlyKilled[source] and recentlyKilled[source] > GetTime() - killSpamTime then
print("Death already reported")
end
if not aura_env.alliance[source] then
print("lol alliance died idiot")
end
local msg = string.format("%s убил %s с помощью %s с переполнением %d", source, destination, spellName, overkill)
for k, v in pairs(toNotify) do
-- SendChatMessage(msg, "WHISPER", nil, v)
table.insert(aura_env.whisperQueue, { to = v, msg = msg })
end
recentlyKilled[source] = GetTime()
end
aura_env.stinkies = WeakAurasSaved.Cyka.Stinkies
aura_env.localStinkies = {}
---@param name string
aura_env.StinkyDetected = function(name)
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
GetTime() - 60 then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
for k, v in pairs(toNotify) do
local msg = string.format("%s в Оргриммаре!", name)
-- SendChatMessage(msg, "WHISPER", nil, v)
table.insert(aura_env.whisperQueue, { to = v, msg = msg })
end
end
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
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
--/run WeakAurasSaved.Cyka.Stinkies["Totleta"] = true
-- /dump WeakAurasSaved.Cyka.Stinkies