找回密码
 注册
搜索
查看: 2859|回复: 26

放个双十一用得着的代码

[复制链接]
门派:姑苏慕容
发表于 2019-11-9 15:13:31 | 显示全部楼层 |阅读模式
本帖最后由 ryru@tj 于 2019-11-10 18:19 编辑

在shujian.lua里面随便找个地方放这段代码就行了,可以放在最后,强调下,不支持自动卖石头
  1. function duihuanSomething()
  2.         exe('score')
  3.         tmp.duihuan=0
  4.         local l_result
  5.         local l_duihuan
  6.         local l_duihuanTimes
  7.         l_result=utils.inputbox ("你需要兑换的物品ID是", "duihuanID", GetVariable("duihuanID"), "宋体" , "12")
  8.         if not isNil(l_result) then
  9.                 SetVariable("duihuanID",l_result)
  10.                 l_duihuan=l_result
  11.                 print(GetVariable("duihuanID"))
  12.         end
  13.         l_result=utils.inputbox ("你需要兑换的次数", "duihuanTimes", GetVariable("duihuanTimes"), "宋体" , "12")
  14.         if not isNil(l_result) then
  15.                 SetVariable("duihuanTimes",l_result)
  16.                 l_duihuanTimes=l_result
  17.                 print(GetVariable("duihuanTimes"))
  18.         end
  19.         DeleteTriggerGroup("duihuanSomething")
  20.         create_trigger_t('duihuanSomething1',"^(> )*当铺老板吆喝一声:"..score.name.."兑换限制级宝物\\D*,收讫书剑通宝(\\D*)个*",'','duihuanSomething_add')
  21.         SetTriggerOption("duihuanSomething1","group","duihuanSomething")
  22.         check_busy(duihuanSomething_duihuan)
  23. end
  24. function duihuanSomething_add(n,l,w)
  25.         tmp.duihuan=tmp.duihuan or 0
  26.         tmp.duihuan=tmp.duihuan+1
  27.         print('本次兑换'..tmp.duihuan..'次')
  28.         if tmp.duihuan>=tonumber(GetVariable("duihuanTimes")) then
  29.                 EnableTriggerGroup("duihuanSomething",false)
  30.                 DeleteTriggerGroup("duihuanSomething")
  31.                 return check_food()
  32.         end
  33.         check_busy(duihuanSomething_duihuan)
  34. end
  35. function duihuanSomething_duihuan()
  36.         exe('duihuan '..GetVariable("duihuanID"))
  37. end
复制代码

另外可以在 function setAlias()里面加一句
  1. create_alias_s('dhsome','dhsome','duihuanSomething')
复制代码

以后输入dhsome就可以用了,这个只限于在当铺兑换,比如培元丹,minerbox,lherb这种。兑换石头,论坛里找无法风的代码

评分

1

查看全部评分

门派:丐帮
发表于 2019-11-9 16:46:37 | 显示全部楼层
方便广大玩家,直接用mush不用切换zmud     
门派:丐帮
发表于 2019-11-9 16:47:18 | 显示全部楼层
支持下如版 居然放出来到现在还没有沙发和板凳      
门派:明教
发表于 2019-11-9 16:59:43 | 显示全部楼层
这个不错,回头我就偷懒加新公版里喽!
门派:桃花岛
发表于 2019-11-9 17:02:53 | 显示全部楼层
好的,无脑拷贝一份,谢谢了
门派:峨嵋派
发表于 2019-11-9 17:53:11 | 显示全部楼层
这个好 每个礼拜的培元丹不用弄timer了
门派:姑苏慕容
发表于 2019-11-9 18:09:42 | 显示全部楼层
哇塞最近大神们纷纷发福利啊
门派:天龙寺
发表于 2019-11-9 18:25:06 | 显示全部楼层
这个可以,方便省事好多。我以前是分开写的。
门派:天龙寺
发表于 2019-11-9 19:41:38 来自手机 | 显示全部楼层
门派:天龙寺
发表于 2019-11-9 19:42:42 | 显示全部楼层
手机发有问题啊。我是说用定时器加Alias也挺方便
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-29 18:52 , Processed in 0.023728 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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