String 插件(哇,Lua)导致严重错误
我正在搜索聊天中的某些单词,然后将它们发送到指定的聊天框。它可以正常工作,但会随机导致错误并导致游戏崩溃 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". 在它崩溃后,我打开引擎浏览这个地区,看看那里有什么 1F97FFFE: http://i.imgur.com/D7XKi2D.jpg 00416DB0: http://i.imgur.com/duTM315.jpg 和插件代码: --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 endString 插件(哇,Lua)导致严重错误,string,lua,access-violation,gsub,lua-patterns,String,Lua,Access Violation,Gsub,Lua Patterns,我正在搜索聊天中的某些单词,然后将它们发送到指定的聊天框。它可以正常工作,但会随机导致错误并导致游戏崩溃 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
有人能帮我解释一下为什么这会使游戏崩溃吗?可能不是你的情况,但请尝试使用string.findarg1,v,1,true而不是string.findarg1,v来避免由于模式中的魔法字符而导致的意外行为
-- Example:
local str = 'string.find hangs on this string'
string.find(str, '.*.*.*.*.*.*.*.*.*.*.*#')
尝试还原到DX9。可能不是由插件引起的。