Add ChatSniffer module and update saved variables
This commit is contained in:
@@ -533,6 +533,7 @@ local function init()
|
|||||||
shared.Configurator.Init()
|
shared.Configurator.Init()
|
||||||
shared.StinkyCache.Init()
|
shared.StinkyCache.Init()
|
||||||
shared.AchievementSniffer.Init()
|
shared.AchievementSniffer.Init()
|
||||||
|
shared.ChatSniffer.Init()
|
||||||
print("Heimdall loaded!")
|
print("Heimdall loaded!")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
## Version: 3.12.0
|
## Version: 3.12.0
|
||||||
## Notes: Watches over areas and alerts when hostiles spotted
|
## Notes: Watches over areas and alerts when hostiles spotted
|
||||||
## Author: Cyka
|
## Author: Cyka
|
||||||
## SavedVariables: Heimdall_Data, Heimdall_Achievements
|
## SavedVariables: Heimdall_Data, Heimdall_Achievements, Heimdall_Chat
|
||||||
|
|
||||||
_L.lua
|
_L.lua
|
||||||
Modules/CLEUParser.lua
|
Modules/CLEUParser.lua
|
||||||
|
|||||||
38
Modules/ChatSniffer.lua
Normal file
38
Modules/ChatSniffer.lua
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
local _, shared = ...
|
||||||
|
---@cast shared HeimdallShared
|
||||||
|
local ModuleName = "ChatSniffer"
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
shared.ChatSniffer = {}
|
||||||
|
function shared.ChatSniffer.Init()
|
||||||
|
Heimdall_Chat = Heimdall_Chat or {}
|
||||||
|
local frame = CreateFrame("Frame")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_SAY")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_YELL")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_WHISPER")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_CHANNEL_JOIN")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_EMOTE")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_PARTY")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_PARTY_LEADER")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_RAID")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_RAID_LEADER")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_RAID_WARNING")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_TEXT_EMOTE")
|
||||||
|
frame:RegisterEvent("CHAT_MSG_YELL")
|
||||||
|
frame:SetScript("OnEvent", function(self, event, msg, sender, language, channel)
|
||||||
|
local log = string.format(
|
||||||
|
"%s|%s|%s|%s|%s",
|
||||||
|
tostring(event),
|
||||||
|
tostring(sender),
|
||||||
|
tostring(msg),
|
||||||
|
tostring(language),
|
||||||
|
tostring(channel)
|
||||||
|
)
|
||||||
|
Heimdall_Chat[#Heimdall_Chat + 1] = log
|
||||||
|
end)
|
||||||
|
|
||||||
|
print("[Heimdall] ChatSniffer loaded")
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user