简单辅助选择加减乘除结果_脚本验证

2021-12-30 12:47:09 作者:

简单辅助_简单挂免费版|传奇单职业辅助_ >> 传奇资讯 >> 正文

 

/<
lastmsg=""
function 过验证()
  local str=获取NPC对话内容()
  if not str or str==lastmsg then return end -- 防止重复过
  lastmsg = str
  local tab={www
              {www"加","+"},{www"减","-"},{www"乘","*"},{www"除","/"},
              {www"+","+"},{www"—","-"},{www"×","*"},{www"÷","/"},
              {www"%[","("},{www"%]",")"},{www"【","("},{www"】",")"},
              {www"{www","("},{www"}",")"},{www"<","("},{www">",")"},
            }
  local function maskstr(str)
    for k,v in ipairs(tab) do
      str=str:gsub(v[1],v[2])
    end
    return str
  end
  if str:match("选择正确的答案") then
    local sf=nil
    local gs = str:match("([0-9+%+%-%—÷×%*加减乘除%[%]%(%)【】{www}]+)=")
    if gs then
      print("计算公式:"..maskstr(gs))
      sf = load("return "..maskstr(gs))
    end
    if sf then
    local num = sf()
      local nearest=65535
      print("计算结果:"..num)
      local cmd = nil
      for k,c in str:gmatch("<(%d+)/(@[^>]+)>") do
        if math.abs(k-num) < nearest then
          nearest = math.abs(k-num)
          cmd = c
        end
      end
      if cmd then
        print(cmd)
        选择(cmd)
        等待(1500)
      end
    end
  end
end
过验证() -- 回收验证保留此行,删除下面一行
设置用户检测("过验证",2000) -- 脱机验证保留此行,删除上面一行
/>