按顺序选择汉字最新挂机验证码
/<
local lastmsg=""
function 过验证()
local str=获取NPC对话内容()
if lastmsg==str then return end
lastmsg=str
if str:match("验证码") then
function GetWords(s)
s=s:gsub(" "," ")
local t={};local ti={};local rt={};
for w in s:gmatch("{([^/]+)/SCOLOR=%d+}") do
local ps=0;local pe=0;
repeat
ps,pe,w1=w:find("([^%s]+)",pe+1)
if ps and w1 then t[ps]=w1;table.insert(ti,ps) end
until not ps
end
table.sort(ti)
for k,v in pairs(ti) do
table.insert(rt,t[v])
end
return rt;
end
function GetCMDs(s)
local rt={}
for w,cmd in s:gmatch("<([^/]+)/(@防脱机[^>]+)>") do
rt[w]=cmd
end
return rt;
end
local cmds = GetCMDs(str)
local words = GetWords(str)
for k,v in ipairs(words) do
if cmds[v] then
选择(cmds[v])
等待(1000)
else
for k2,v2 in pairs(cmds) do
if 拼音比较(v,k2) then
选择(v2)
等待(1000)
break;
end
end
end
end
end
end
过验证() -- 回收验证保留此行,删除下面一行
设置用户检测("过验证",2000) -- 脱机验证保留此行,删除上面一行
/>