View Single Post
09-25-15, 08:44 AM   #13
Gryns
A Deviate Faerie Dragon
 
Gryns's Avatar
Join Date: Sep 2015
Posts: 11
Originally Posted by semlar View Post
Please post exactly what you have in the file.
Of course, I merged all the scripts that you gave me so far. This is what I have:


Code:
-- This file is loaded from "ChatHideRealm.toc"

-- ChatHideRealm
local a,g = getmetatable(DEFAULT_CHAT_FRAME).__index.AddMessage,gsub
getmetatable(DEFAULT_CHAT_FRAME).__index.AddMessage = function(s,t,...)
    if s == ChatFrame2 then return a(s,t,...) end -- combat log
    return a(s,g(t,"|Hplayer:(.-)|h(.-)|h",function(a,b)
        return "|Hplayer:"..a.."|h"..g(b,"-([^%]:]+)(.*)","%2|r").."|h"
    end),...)
end

ChatFrame_AddMessageEventFilter('CHAT_MSG_SYSTEM', function(self, event, msg, ...)
    return false, (msg:gsub('%f[^\0%s]([^\1-\64\91-\96\123-191]+)%-%u%l%a+%f[\0%s]', '%1')), ...
end)
    
hooksecurefunc('ChatEdit_UpdateHeader', function(editBox)
    local header = _G[editBox:GetName() .. 'Header']
    if editBox:GetAttribute('chatType') == 'WHISPER' and header then
        _G[editBox:GetName() .. 'HeaderSuffix']:Hide()
        header:SetWidth(0)
        header:SetFormattedText(CHAT_WHISPER_SEND, (strsplit('-', editBox:GetAttribute('tellTarget'))))
        editBox:SetTextInsets(15 + (header:GetRight() or 0) - (header:GetLeft() or 0), 13, 0, 0)
    end
end)
The error is shown in line 13;
return false, (msg:gsub('%f[^\0%s]([^\1-\64\91-\96\123-191]+)%-%u%l%a+%f[\0%s]', '%1')), ...
Which as far as I can tell has all the opening and closing brackets.

I tried using the code as a seperate addon, and Bugger encounters the same error with that same line.
__________________
-- Live like a King, laugh like his Jester. --

Last edited by Gryns : 09-25-15 at 09:22 AM.
  Reply With Quote