//下面代码放到挂机脚本最后
触发器(人物[当前地图=Nhero1])->跳转[走验证]
<走验证>
关闭触发器[]
/<
local x,y= 获取最近光柱坐标()
if x and y then
走到(x,y)
等待(500)
end
/>
对话[14,11] -- 这里改成正确的NPC坐标或NPC名称
等待[1500]
/<
local tab={
{"加","+"},{"减","-"},{"乘","*"},{"除","/"},
{"+","+"},{"—","-"},{"×","*"},{"÷","/"},
{"[","("},{"]",")"},{"【","("},{"】",")"},
{"{","("},{"}",")"},{"<","("},{">",")"},
}
local function maskstr(str)
for k,v in ipairs(tab) do
if v[1]==str then return v[2] end
end
return str
end
lastmsg=""
function 过验证()
local str=获取NPC对话内容()
if lastmsg==str then return end
lastmsg=str
if str:match("输入验证数字") then
n1,f,n2=str:match("〖/SCOLOR=%d+>(%d+)<〗(..)[^/]+〖/SCOLOR=%d+>(%d+)<〗")
if not n1 or not f or not n2 then return end
local content=nil
if f=="位" then
local n3=str:match("【/SCOLOR=%d+>(%d+)<】")
if n3 then
content=n3:sub(tonumber(n1),tonumber(n1))..n3:sub(tonumber(n2),tonumber(n2))
end
else
local bds=n1..maskstr(f)..n2
local fn=load("return "..bds)
if fn then
content=tostring(fn())
content=content:match("(%d+)")
end
end
if content then
local cmd=str:match("/(@@[^>]+)>")
if cmd then
合成命令(cmd,content)
等待(cmd,content)
end
end
end
end
过验证()
/>
开启触发器[]
跳转[脚本开始]