%s in a patterns matches a space so instead of replacing it with %s- you would instead probably need to replace it with a .+, I know cargor probably knows this and has just made a silly mistake :P
lua Code:
local patterns = {}
local limit = 4
for i = 1, limit do
patterns[(i*2)-1] = _G["DRUNK_MESSAGE_ITEM_OTHER"..i]:gsub("%%s", "%s-")) -- odd
patterns[i*2] = _G["DRUNK_MESSAGE_OTHER"..i]:gsub("%%s", "%s-") -- even
end
local function intox(f, e, msg)
for i = 1, limit * 2 do
if msg:find(pattern) then
return true
end
end
return false
end
ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", intox)
is what I would use.
edit: Grrrr why on earth can't [highlight] handle parenthesis
.