|
发表于 2019-12-12 17:42:13
|
显示全部楼层
/<
lastmsg=""
function 过验证()
local str = 获取NPC对话框内容()
if lastmsg==str then return end
lastmsg=str
if str:match("问题") then
答题表 = { -- 题表开始
{问="7只猴",答="8只猴"},
{问="等于多少元宝",答="10000元宝"},
{问="比例是多少",答="1:4000"},
{问="12%+6",答="18"},
{问="5×6=",答="30"},
{问="橙汁是什么",答="饮料"},
{问="三轮车有几个轮子",答="三个"},
} -- 题表结束
local r = NULL
for k,v in ipairs(答题表) do
p = str:find(v.问)
if p ~= NULL then
r = v
break
end
end
local cmd = nil
if r then
local t = str:find(r.问)
if t then
cmd = str:match("<[^/]*"..r.答.."[^/]*/(@[^>]+)>",t)
end
end
if cmd then
选择(cmd)
等待(1500)
按键(13)
end
end
end
过验证() -- 回收验证保留此行,删除下面一行
设置用户检测("过验证",2000) -- 脱机验证保留此行,删除上面一行
/> |
|