Compare commits

...

4 Commits

Author SHA1 Message Date
740f69ebe8 Add spotter weakaura 2024-11-28 20:07:59 +01:00
5fbaf869f8 Make whosniffer use messenger 2024-11-28 19:45:09 +01:00
d6132848db Add messenger, shared weakaura to use chat 2024-11-28 19:44:59 +01:00
56a08b6cca Refactpr whosniffer a lil 2024-11-28 19:04:05 +01:00
9 changed files with 220 additions and 58 deletions

View File

@@ -0,0 +1,24 @@
-- NAME_PLATE_UNIT_ADDED NAME_PLATE_UNIT_REMOVED
function(event, unit)
local name = UnitName(unit)
if name and UnitIsPlayer(unit) then
local race = UnitRace(unit)
local doNotify = true
if aura_env.config.allyOnly then
doNotify = false
if aura_env.raceMap[race] == "Alliance" then
doNotify = true
end
end
-- Stinkies overwrite allyOnly
if aura_env.config.stinkyOnly then
doNotify = false
if WeakAurasSaved.Cyka.stinkies[name] then
doNotify = true
end
end
if doNotify then
aura_env.NotifySpotted(name, race)
end
end
end

1
FreshShit/Spotter/export Normal file
View File

@@ -0,0 +1 @@
!fJrdVjUn0FlRtNgvRf1spDtt6UTrBPxldcCnPTsxvdXK4a(QXMz70wUPl)23Z25lGuGDAstGGe733p)(Wp)J998DN57gP)cpYtuucd77o4gVEx50X3nMZuUKVI9DoULVlkrnLlgmxr4mjGGJHaQfZbuu8jtOW)js85yzO)yF3hXlaCO0fdyu4PiCmkHQ07WqZaqBtPeeleNgWba(DF3NjrQPAQQ8DAToPn0tQiShZOyfEzPORzZc6vHJvj9jAsNTqRCMqyZtuLO4cgg4FIXEKRlFLRnoumBIHwhLZ2pBwhKME2TgdCrtlICofTWd)c8YBM77UyqCSedsaGPapbSIEwf0aXZCr0Dcea3Dfp9sfmc5uUWA11FBz(9eZVV1QzUHjsfFMMH3mpcPasJFcZugphFgsrcVZO2UTH3HvdZ9KGzfjuWdaSXegro1(m8OEv3i(ilT9pnNlGHGhIOPbHtrmgMEvuAWhsdyeAA30UhE4H)rifjLPb9XsjAc2UwmbtbaNLTwGujiSjlTxg9QDpqPqLBy3s7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6smIQVEuoSdfydSUd70RN(YHJbKT3z7Yo9gEXnWIj6Ri5A15sUPBkYPD)oJg2RTxNr34CL3O2NFENZxF5R70FWTWgDlIhn8g0ynPRjumV49nW2ARCJvGRSsn09QfSRKdncygOVYH1mgyZOKXGRHxwLbRaFe3MBXg1lsW1xYB1OP8jdSTsGlr(y0glPTeFYU8296)FW22szpU7Axl7GYT7nVK)rF6WmRccgcD4pHfplikTdl3MStwWYzH8FTnSUWrzMaFpZM)8)r7Nwelj8MfK6la2GvB1UxVphBohZaFK2zJyd1hzZYKLarohtH0Ozqywu67(VlrqbLNsI0dhcQ8fPPwcRm3Mj3NE8npH9Sl2Nda7C4Xhz2HfoLlgcDnbVCwhhVoxRNLJclyi6Tq6silJVtR357(fGvGvX3TxNl0JbctJZq70bEEd6dOfb5)mgnD6nolIKp0i9SIGwqWqoxOqIo)BgJVqVQnnP7zx3PJJEgEHpLZ3F5OtoYmpl9Hy7WNkMP34ktm808jUz4exluxiiFnn4tjOiHP2LNNjz91MHPLjtigrpQlGtvMRLBeCmqVyM)sI1QImVibtZha3zicB3HUysz7g8gmEbhDx2Oh1gbkhzg9kCWj0mnw9qhZDWMbOT2Qs98yxzr9XdTJQ)DdKp)RZ(Ro9xya13TvZJFxZt8DFc8pVTLEkH()d

View File

@@ -0,0 +1,93 @@
local channelId = nil
---@class Message
---@field message string
---@field channel string
---@field data string
---@type Message[]
aura_env.messageQueue = {}
---@type table<string, string>
aura_env.raceMap = {
["Orc"] = "Horde",
["Undead"] = "Horde",
["Tauren"] = "Horde",
["Troll"] = "Horde",
["Blood Elf"] = "Horde",
["Goblin"] = "Horde",
["Human"] = "Alliance",
["Dwarf"] = "Alliance",
["Night Elf"] = "Alliance",
["Gnome"] = "Alliance",
["Draenei"] = "Alliance",
["Worgen"] = "Alliance",
["Vulpera"] = "Horde",
["Nightborne"] = "Horde",
["Zandalari Troll"] = "Horde",
["Kul Tiran"] = "Alliance",
["Dark Iron Dwarf"] = "Alliance",
["Void Elf"] = "Alliance",
["Lightforged Draenei"] = "Alliance",
["Mechagnome"] = "Alliance",
["Mag'har Orc"] = "Horde"
}
-- CHANNEL fuckery
local channel = aura_env.config.channel or "foobar"
local password = aura_env.config.channelPassword
local function FindOrJoinChannel(channelName, password)
local function GetChannelId(channelName)
local channels = {GetChannelList()}
for i = 1, #channels, 2 do
local id = channels[i]
local name = channels[i + 1]
if name == channelName then
return id
end
end
end
channelId = GetChannelId(channelName)
if not channelId then
print(string.format("channel %s not found, joining", channelName))
if password then
JoinPermanentChannel(channelName, password)
else
JoinPermanentChannel(channelName)
end
end
channelId = GetChannelId(channelName)
return channelId
end
channelId = FindOrJoinChannel(channel, password)
print(string.format("channel %s resolved to id %d", channel, channelId))
local zone = aura_env.config.zone
local throttleTimer = aura_env.config.throttle or 10
local throttleMap = {}
---@param playerName string
---@param race string
---@return nil
aura_env.NotifySpotted = function(playerName, race)
local now = GetTime()
local throttleTime = throttleMap[playerName] or 0
if now - throttleTime < throttleTimer then
return
end
throttleMap[playerName] = now
local zone = aura_env.config.zone
if not zone then
zone = GetZoneText() .. " " .. GetSubZoneText()
end
local message = {
channel = "CHANNEL",
data = channelId,
message = string.format("I see %s at %s!", playerName, zone)
}
table.insert(WeakAurasSaved.Cyka.MessageQueue, message)
end

View File

@@ -1,9 +1,17 @@
-- TICKER_200
function()
---@type Message
local message = aura_env.messageQueue[1]
if message == nil then return end
table.remove(aura_env.messageQueue, 1)
SendChatMessage(message.message, message.channel, nil, message.data)
-- CHAT_MSG_WHISPER
---@type event string
---@type msg string
---@type sender string
function(event, msg, sender)
if msg == "who" then
for _, player in pairs(aura_env.stinkies) do
local msg = aura_env.MakeNotifyMessage(player)
local message = {
channel = "WHISPER",
data = sender,
message = msg
}
table.insert(WeakAurasSaved.Cyka.MessageQueue, message)
end
end
end

View File

@@ -1,17 +1,22 @@
-- CHAT_MSG_WHISPER
-- CHAT_MSG_CHANNEL
---@type event string
---@type msg string
---@type sender string
function(event, msg, sender)
function(event, msg, sender, ...)
local channelId = select(6, ...)
if channelId ~= aura_env.channelId then
return
end
if msg == "who" then
for _, player in pairs(aura_env.stinkies) do
local msg = aura_env.MakeNotifyMessage(player)
local message = {
channel = "WHISPER",
data = sender,
channel = "CHANNEL",
data = channelId,
message = msg
}
table.insert(aura_env.messageQueue, message)
table.insert(WeakAurasSaved.Cyka.MessageQueue, message)
end
end
end
end

View File

@@ -1,22 +0,0 @@
-- CHAT_MSG_CHANNEL
---@type event string
---@type msg string
---@type sender string
function(event, msg, sender, ...)
local channelId = select(6, ...)
if channelId ~= aura_env.channelId then
return
end
if msg == "who" then
for _, player in pairs(aura_env.stinkies) do
local msg = aura_env.MakeNotifyMessage(player)
local message = {
channel = "CHANNEL",
data = channelId,
message = msg
}
table.insert(aura_env.messageQueue, message)
end
end
end

View File

@@ -106,8 +106,9 @@ end
---@field channel string
---@field data string
---@type Message[]
aura_env.messageQueue = {}
if not WeakAurasSaved.Cyka.MessageQueue then
WeakAurasSaved.Cyka.MessageQueue = {}
end
aura_env.whoQueryIdx = 1
---@type table<number, WHOQuery>
aura_env.whoQueries = {}
@@ -255,7 +256,7 @@ local NotifyAll = function(msg)
data = rec,
message = msg
}
table.insert(aura_env.messageQueue, message)
table.insert(WeakAurasSaved.Cyka.MessageQueue, message)
end
end
---@param msg string
@@ -269,7 +270,7 @@ local NotifyChannel = function(msg)
data = channelId,
message = msg
}
table.insert(aura_env.messageQueue, message)
table.insert(WeakAurasSaved.Cyka.MessageQueue, message)
end
---@param player Player
@@ -309,31 +310,34 @@ aura_env.NotifyGone = function(player)
end
-- CHANNEL fuckery
local channel = aura_env.config.channelName or "foobar"
local channel = aura_env.config.channel or "foobar"
local password = aura_env.config.channelPassword
local function GetChannelId(channelName)
local channels = {GetChannelList()}
for i = 1, #channels, 2 do
local id = channels[i]
local name = channels[i + 1]
if name == channelName then
return id
local function FindOrJoinChannel(channelName, password)
local function GetChannelId(channelName)
local channels = {GetChannelList()}
for i = 1, #channels, 2 do
local id = channels[i]
local name = channels[i + 1]
if name == channelName then
return id
end
end
end
end
channelId = GetChannelId(channel)
if not channelId then
print(string.format("channel %s not found, joining", channel))
if password then
JoinPermanentChannel(channel, password)
else
JoinPermanentChannel(channel)
channelId = GetChannelId(channelName)
if not channelId then
print(string.format("channel %s not found, joining", channelName))
if password then
JoinPermanentChannel(channelName, password)
else
JoinPermanentChannel(channelName)
end
end
channelId = GetChannelId(channelName)
return channelId
end
channelId = GetChannelId(channel)
aura_env.channelId = channelId
aura_env.channelId = FindOrJoinChannel(channel, password)
print(string.format("channel %s resolved to id %d", channel, channelId))
---@param player Player

View File

@@ -0,0 +1,48 @@
-- TICKER_200
function()
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
if not WeakAurasSaved.Cyka.MessageQueue then WeakAurasSaved.Cyka.MessageQueue = {} end
---@type Message
local message = WeakAurasSaved.Cyka.MessageQueue[1]
if message == nil then return end
table.remove(WeakAurasSaved.Cyka.MessageQueue, 1)
SendChatMessage(message.message, message.channel, nil, message.data)
end
--INIT
local function FindOrJoinChannel(channelName, password)
local function GetChannelId(channelName)
local channels = {GetChannelList()}
for i = 1, #channels, 2 do
local id = channels[i]
local name = channels[i + 1]
if name == channelName then
return id
end
end
end
channelId = GetChannelId(channelName)
if not channelId then
print(string.format("channel %s not found, joining", channelName))
if password then
JoinPermanentChannel(channelName, password)
else
JoinPermanentChannel(channelName)
end
end
channelId = GetChannelId(channelName)
return channelId
end
aura_env.channelId = FindOrJoinChannel(aura_env.channel, aura_env.channelPassword)
--aura_env.iterator = 0
--WeakAurasSaved.Cyka.MessageQueue = {}
--for i = 1, 100 do
-- table.insert(WeakAurasSaved.Cyka.MessageQueue, {
-- channel = "CHANNEL",
-- data = aura_env.channelId,
-- message = "TEST" .. i
-- })
--end

View File

@@ -0,0 +1 @@
!DEvBVjooq4)l90kr1vqaDV9(0jDD5sF7ObAD61pS6mXK4aEBWgf7W2Uvn)2VzStGqGULBvRGKXZZ8(mEG2JgqjlOKy8F4rvUj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