找回密码
 注册
搜索
查看: 377|回复: 1

优化如版的自动兑换通宝道具和原石机器人

[复制链接]
门派:明教
发表于 2020-10-11 15:21:37 | 显示全部楼层 |阅读模式
  1. function duihuanSomething()
  2.         exe('score;l paizi')
  3.         tmp.duihuan=0
  4.         local l_result
  5.         local l_duihuan
  6.         local l_duihuanTimes
  7.                 if locl.room=='打铁铺' then
  8.            SetVariable("duihuan_cmd",'exchange')
  9.             else
  10.                    SetVariable("duihuan_cmd",'duihuan')
  11.             end
  12.         l_result=utils.inputbox ("你需要兑换的物品ID是", "duihuanID", GetVariable("duihuanID"), "宋体" , "12")
  13.         if not isNil(l_result) then
  14.                 SetVariable("duihuanID",l_result)
  15.                 l_duihuan=l_result
  16.                 print(GetVariable("duihuanID"))
  17.          end
  18.         l_result=utils.inputbox ("你需要兑换的次数", "duihuanTimes", GetVariable("duihuanTimes"), "宋体" , "12")
  19.         if not isNil(l_result) then
  20.                 SetVariable("duihuanTimes",l_result)
  21.                 l_duihuanTimes=l_result
  22.                 print(GetVariable("duihuanTimes"))
  23.          end
  24.         DeleteTriggerGroup("duihuanSomething")
  25.         create_trigger_t('duihuanSomething1',"^(> )*当铺老板吆喝一声:"..score.name.."兑换限制级宝物\\D*,收讫书剑通宝(\\D*)个*",'','duihuanSomething_add')
  26.         create_trigger_t('duihuanSomething2',"^(> )*你拿出一块原石换到一颗\\D*",'','duihuanSomething_add')
  27.         SetTriggerOption("duihuanSomething1","group","duihuanSomething")
  28.         SetTriggerOption("duihuanSomething2","group","duihuanSomething")
  29.         check_busy(duihuanSomething_duihuan)
  30. end
  31. function duihuanSomething_add(n,l,w)
  32.         tmp.duihuan=tmp.duihuan or 0
  33.         tmp.duihuan=tmp.duihuan+1
  34.         print('本次兑换'..tmp.duihuan..'次')
  35.         if tmp.duihuan>=tonumber(GetVariable("duihuanTimes")) then
  36.                 EnableTriggerGroup("duihuanSomething",false)
  37.                 DeleteTriggerGroup("duihuanSomething")
  38.                 return check_food()
  39.         end
  40.         check_busy(duihuanSomething_duihuan)
  41. end
  42. function duihuanSomething_duihuan()
  43.         idle()
  44.         exe(GetVariable("duihuan_cmd")..' '..GetVariable("duihuanID"))
  45. end
复制代码

评分

1

查看全部评分

门派:明教
 楼主| 发表于 2020-10-11 15:25:22 | 显示全部楼层
优化一:兑换前加入了look paizi指令,因为原石这种兑换,经常记不清名字,需要查看一下。
优化二:如版的版本需要人工输入“duihuan”或是“exchange”指令,多一道手续,我这人能懒就懒,用locl.room判定,凡是打铁铺就是exchange,其它都是duihuan,反正指令不对机器人就停下了,测试一下,好用!

再次感谢如版,机器人真得好用,方便许多啊!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|书剑永恒MUD ( 闽ICP备14012032号|闽公网安备 35050202000162号 )

GMT+8, 2025-6-6 12:24 , Processed in 0.029670 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表