So since Brewfest is upon us I've realized how annoying the tipsy/drunk spam is (its always kind of irked me, but this event really made me want to do something about it). I'm wanting to filter out the DRUNK_MESSAGE_OTHER and DRUNK_MESSAGE_ITEM_OTHER system messages, but I don't really have all of the know how to piece everything together.
I'm pretty sure that there needs to be a ChatFrame_AddMessageEventFilter in there along with a gsub or two, but like I said my knowledge of LUA is amateur at best.
The messages that I'd like to filter from the
GlobalStrings.lua are:
DRUNK_MESSAGE_ITEM_OTHER1 = "%s is looking sober from the %s.";
DRUNK_MESSAGE_ITEM_OTHER2 = "%s seems a little tipsy from the %s.";
DRUNK_MESSAGE_ITEM_OTHER3 = "%s is getting drunk off of %s.";
DRUNK_MESSAGE_ITEM_OTHER4 = "%s is completely smashed from the %s.";
DRUNK_MESSAGE_OTHER1 = "%s seems to be sobering up.";
DRUNK_MESSAGE_OTHER2 = "%s looks tipsy.";
DRUNK_MESSAGE_OTHER3 = "%s looks drunk.";
DRUNK_MESSAGE_OTHER4 = "%s looks completely smashed.";
I tried to guess and throw a little something together after looking at a couple of mods that do much more than I want, but it completely destroys the CHAT_MSG_SYSTEM
lua Code:
local function intox(frame, event, msg, ...)
for i=1,4 do
if msg:match("DRUNK_MESSAGE_ITEM_OTHER"..i) then
msg:gsub("%%s", ".*")
elseif msg:match("DRUNK_MESSAGE_OTHER"..i) then
msg:gsub("%%s", ".*")
end
end
end
ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", intox)
(I'm not sure if this is the one that did nothing or broke everything.)
Any help with this is greatly appreciated.