The addon I'm making searchs for certain words within chats and then sends them to a specified chatframe it works but randomly it causes an error and crashes the game
This application has encountered a critical error: ERROR #132 (0x85100084) Fatal Exception Program: C:\WoW\Wow.exe Exception: 0xC0000005 (ACCESS_VIOLATION) at 0023:00416DB0 The instruction at "0x00416DB0" referenced memory at "0x1F97FFFE". The memory could not be "read".
I opened cheatengine to browse the region after it crashed to see what was there
1F97FFFE: http://i.imgur.com/D7XKi2D.jpg 00416DB0: http://i.imgur.com/duTM315.jpg
and the addon code:
--Event CHAT_MSG_CHANNEL
if event == "CHAT_MSG_CHANNEL" then
if TriggerEnabled then
local arg1 = string.lower(arg1)
local found, dump = false, false
for k,v in pairs(lsus.Triggers) do
if not found then
for k,v in pairs(lsus.NegTriggers) do
if (string.find(arg1, v)) then
dump = true
end
end
if (string.find(arg1, v)) and not dump then
local output = " [\124Hplayer:" .. arg2 .. ":1:WHISPER\124h" .. arg2 .. "\124h\124r]: " .. arg1:gsub(v, "\124c0000FF00\124h" .. string.upper(v) .. "\124h\124r")
print(output, 0.41, 0.80, 0.94)
found = true
end
end
end
end
end
--print function
function print(msg, r, g, b)
if not r then
ChatFrame1:AddMessage(msg)
else
ChatFrame1:AddMessage(msg, r, g, b)
end
end
can anyone help me with why this is crashing the game?