找回密码
 注册
搜索
查看: 556|回复: 6

自动兑换更新版,支持当铺兑换,和铁匠铺duihuan 原石

[复制链接]
门派:姑苏慕容
发表于 2020-4-22 19:51:49 | 显示全部楼层 |阅读模式
看到有人问,发一个吧,比以前那个要麻烦点,就分开发了

不支持红蓝石头,红蓝石头的找无法的code

  1. function duihuanSomething()
  2.         exe('score')
  3.         tmp.duihuan=0
  4.         local l_result
  5.         local l_duihuan
  6.         local l_duihuanTimes
  7.         local l_cmd
  8.         l_result=utils.inputbox ("你需要使用的命令是(duihuan/exchange)", "命令", GetVariable("duihuan_cmd"), "宋体" , "12")
  9.         if not isNil(l_result) then
  10.                 SetVariable("duihuan_cmd",l_result)
  11.                 l_cmd=l_result
  12.         end
  13.         l_result=utils.inputbox ("你需要兑换的物品ID是", "duihuanID", GetVariable("duihuanID"), "宋体" , "12")
  14.         if not isNil(l_result) then
  15.                 SetVariable("duihuanID",l_result)
  16.                 l_duihuan=l_result
  17.                 print(GetVariable("duihuanID"))
  18.         end
  19.         l_result=utils.inputbox ("你需要兑换的次数", "duihuanTimes", GetVariable("duihuanTimes"), "宋体" , "12")
  20.         if not isNil(l_result) then
  21.                 SetVariable("duihuanTimes",l_result)
  22.                 l_duihuanTimes=l_result
  23.                 print(GetVariable("duihuanTimes"))
  24.         end
  25.         DeleteTriggerGroup("duihuanSomething")
  26.         create_trigger_t('duihuanSomething1',"^(> )*当铺老板吆喝一声:"..score.name.."兑换限制级宝物\\D*,收讫书剑通宝(\\D*)个*",'','duihuanSomething_add')
  27.         create_trigger_t('duihuanSomething2',"^(> )*你拿出一块原石换到一颗\\D*",'','duihuanSomething_add')
  28.         SetTriggerOption("duihuanSomething1","group","duihuanSomething")
  29.         SetTriggerOption("duihuanSomething2","group","duihuanSomething")
  30.         check_busy(duihuanSomething_duihuan)
  31. end
  32. function duihuanSomething_add(n,l,w)
  33.         tmp.duihuan=tmp.duihuan or 0
  34.         tmp.duihuan=tmp.duihuan+1
  35.         print('本次兑换'..tmp.duihuan..'次')
  36.         if tmp.duihuan>=tonumber(GetVariable("duihuanTimes")) then
  37.                 EnableTriggerGroup("duihuanSomething",false)
  38.                 DeleteTriggerGroup("duihuanSomething")
  39.                 return check_food()
  40.         end
  41.         check_busy(duihuanSomething_duihuan)
  42. end
  43. function duihuanSomething_duihuan()
  44.         idle()
  45.         exe(GetVariable("duihuan_cmd")..' '..GetVariable("duihuanID"))
  46. end
复制代码

评分

2

查看全部评分

门派:武当派
发表于 2020-4-22 20:08:14 | 显示全部楼层
好的 感谢如版分享
门派:明教
发表于 2020-4-22 20:21:56 | 显示全部楼层
好东西啊!感谢如版分享!            
门派:不明
发表于 2020-4-23 06:29:29 | 显示全部楼层
感谢分享,mark一下先,现在还没东西可兑换
门派:桃花岛
发表于 2020-4-23 11:44:22 | 显示全部楼层
感谢如版无私分享,以后用得着。
门派:武当派
发表于 2020-5-6 14:42:04 | 显示全部楼层
感谢分享,先标记一下,以后用:)
门派:天龙寺
发表于 2020-5-6 22:20:18 | 显示全部楼层
感谢如版,是我提问过,谢谢了。            
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-7 04:46 , Processed in 0.041255 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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