Files
wow-weakauras/FreshShit/WhoSniffer/event.lua

40 lines
1.2 KiB
Lua

-- WHO_LIST_UPDATE
function()
for i = 1, GetNumWhoResults() do
local name, guild, level, race, class, zone = GetWhoInfo(i)
local faction = aura_env.raceMap[race]
if not faction then print("Unknown faction for race", race) end
if faction == "Alliance" then
local player = aura_env.alliance[name]
if not player then
player = Player.new(name, guild, race, class, zone)
local timestamp = date("%Y-%m-%dT%H:%M:%S")
if not WeakAurasSaved.Cyka.WhoSniffer[name] then WeakAurasSaved.Cyka.WhoSniffer[name] = {} end
WeakAurasSaved.Cyka.WhoSniffer[name][timestamp] = {
["name"] = name,
["guild"] = guild,
["race"] = race,
["class"] = class,
["zone"] = zone,
}
local stinky = WeakAurasSaved.Cyka.stinkies[name]
if stinky then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
else
PlaySoundFile("Interface\\Sounds\\Cloak.ogg", "Master")
end
aura_env.Notify(player)
end
player:Touch()
player.zone = zone
aura_env.alliance[name] = player
end
end
-- Turns out WA cannot do this (
-- aura_env.UpdateMacro()
_G["FriendsFrameCloseButton"]:Click()
end
--/run WeakAurasSaved.Cyka.WhoSniffer = {}