找回密码
 注册
搜索
楼主: marmot@tj

新版本--全自动蝶梦楼11月2日更新--修复昨天出的乌龙

[复制链接]
门派:姑苏慕容
发表于 2018-10-30 23:41:10 | 显示全部楼层
marmot@tj 发表于 2018-10-30 22:14
如果是提示某个函数没有定义那没关系的直接关闭就好了。
另外我忘了说了务必先设置一次或是在下次打蝶梦 ...

对是提示某个函数缺失
另外帖子里好像没说怎么开始设置。
门派:嵩山派
 楼主| 发表于 2018-10-30 23:45:33 | 显示全部楼层
ddadao@tj 发表于 2018-10-30 23:41
对是提示某个函数缺失
另外帖子里好像没说怎么开始设置。

我前面忘记说了,你把logs文件夹里面那个蝶梦楼的log先删除掉。等他去蝶梦楼的时候就会弹出对话框让你设置了,设置好后以后就不需要了
门派:丐帮
发表于 2018-10-31 05:56:16 | 显示全部楼层
……又更新了?好勤奋啊,不过我现在只能用到模式三的功能,其他的功能对我来说没用的。
明天可以用几个号帮忙测试一下,看看有没有问题。
门派:嵩山派
 楼主| 发表于 2018-10-31 10:26:36 | 显示全部楼层
honglian@tj 发表于 2018-10-31 05:56
……又更新了?好勤奋啊,不过我现在只能用到模式三的功能,其他的功能对我来说没用的。
明天可以用几个号 ...

模式1和2的话比较傻瓜式,条件是:1、等级小于你的等级减去20级,2、从低到高排列,模式1每个目标打两次,模式2打1次
门派:古墓派
发表于 2018-10-31 16:16:49 | 显示全部楼层
C:\MUSHS\log.mcl
Run-time error
World: tj.sjever.net
Function/Sub: haltok called by trigger
Reason: 正在处理触发器 "check_halt1"
[string "Script file"]:1881: attempt to compare nil with number
stack traceback:
        [string "Script file"]:1881: in function <[string "Script file"]:1868>
        (tail call): ?
        (tail call): ?
        (tail call): ?
        (tail call): ?
        (tail call): ?
脚本错误处的上下文:
1877 :        return xunCheng()
1878 :     end
1879 :      create_triggerex_lvl('dmlflag1','^(> )*【江湖传闻】玩家竞技活动开始了!','','dml_on',95)
1880 :      SetTriggerOption('dmlflag1','group','hp')
1881*:      if dmlFightCnt < 5 and (not condition.busy or condition.busy == 0) then
1882 :         local fn = 'logs\\diemenglou_mark_'..score.id..'.log'
1883 :             local f = io.open(fn,"r")
1884 :             if not f then
1885 :            ColourNote('orange','black','未检测到蝶梦楼记录,准备进行蝶梦楼竞技!')


老大们,这个是什么问题啊!
门派:嵩山派
 楼主| 发表于 2018-10-31 16:39:49 | 显示全部楼层
xuexue@tj 发表于 2018-10-31 16:16
C:\MUSHS\log.mcl
Run-time error
World: tj.sjever.net

你加一行  if not dmlFightCnt then dmlFightCnt = 0 end 在1881行之上
门派:嵩山派
 楼主| 发表于 2018-10-31 16:43:56 | 显示全部楼层
xuexue@tj 发表于 2018-10-31 16:16
C:\MUSHS\log.mcl
Run-time error
World: tj.sjever.net

之前说明的时候少写了这句。我现在重新加上了
门派:嵩山派
 楼主| 发表于 2018-11-1 15:19:14 | 显示全部楼层
本帖最后由 marmot@tj 于 2018-11-1 16:15 编辑

不知道为什么更新不了附件了,只好把最新的代码放上来大家复制粘贴到diemenglou.lua里面去吧


  1. ------------------------------------------------------------------------------------------------------默认变量模块------------------------------------------------------------------------------------------------------

  2.     userRank = 0
  3.         userLvl = 0
  4.     targetRank = 0
  5.     targetLvl = 0
  6.     dmlCheckCnt = 0
  7.     dmlsucceedCnt = 0
  8.     dmlPrestige = 0
  9.     dmlCompetitionCoin = 0
  10.         dmlFightCnt = 0
  11.         l_cnt = 0
  12.     askCnt = 0
  13.     targetName = ''
  14.     targetId = ''
  15.     target = {}
  16.         _target = {}
  17.     blackList = {}
  18.         pkList = {}
  19.         backupList = {}
  20.         _t1 = 0
  21.         _t2 = 0
  22.         pkCnt = 1
  23.         pkWaitCnt = 0
  24.        
  25. ------------------------------------------------------------------------------------------------------主触发器模块------------------------------------------------------------------------------------------------------

  26. function dmlTriggers()   
  27.     DeleteTriggerGroup("dmlXueAsk")
  28.         create_trigger_t('dmlXueAsk1','^(> )*你向薛慕华打听有关『疗伤』的消息。,'','dmlXueAccept')
  29.         create_trigger_t('dmlXueAsk2','^(> )*这里没有这个人','','chedml_xue_fail')
  30.         for i = 1,2 do SetTriggerOption("dmlXueAsk" .. i,"group","dmlXueAsk") end
  31.         EnableTriggerGroup('dmlXueAsk',false)
  32.         DeleteTriggerGroup("dmlXueAccept")
  33.         create_trigger_t('dmlXueAccept1','^(> )*薛慕华「嘿嘿嘿」奸笑了几声。,'','dmlXueTeach')
  34.         create_trigger_t('dmlXueAccept2','^(> )*一柱香的工夫过去了,你觉得伤势已经基本痊愈了。','','dmlXueHeal')
  35.         create_trigger_t('dmlXueAccept3','^(> )*薛神医拿出一根银针轻轻捻入你受伤部位附近的穴道','','dmlXueWait')
  36.         create_trigger_t('dmlXueAccept4','^(> )*薛慕华似乎不懂你的意思。,'','dmlXueHeal')
  37.         create_trigger_t('dmlXueAccept5','^(> )*薛慕华「啪」的一声倒在地上,挣扎着抽动了几下就死了。,'','dml_xue_fail')
  38.         for i = 1,5 do SetTriggerOption("dmlXueAccept" .. i,"group","dmlXueAccept") end
  39.         EnableTriggerGroup("dmlXueAccept",false)
  40.         DeleteTriggerGroup("dmlXueTeach")
  41.         create_trigger_t('dmlXueTeach1','^(> )*薛神医的这个技能已经不能再进步了。,'','dmlXueNext')
  42.         SetTriggerOption("dmlXueTeach1","group","dmlXueTeach")
  43.         EnableTriggerGroup("dmlXueTeach",false)
  44.         DeleteTriggerGroup("dmlXueBusy")
  45.         create_trigger_t('dmlXueBusy1','^(> )*您先歇口气再说话吧。,'','dmlXueBusy')
  46.         SetTriggerOption("dmlXueBusy1","group","dmlXueBusy")
  47.         EnableTriggerGroup("dmlXueBusy",false)
  48.     DeleteTriggerGroup('dmldazuo')
  49.         create_trigger_t('dmldazuo1','^(> )*(过了片刻,你感觉自己已经将玄天无极神功|你将寒冰真气按周天之势搬运了一周|你只觉真力运转顺畅,周身气力充沛|你将纯阳神通功运行完毕|你只觉神元归一,全身精力弥漫|你将内息走了个一个周天|你将内息游走全身,但觉全身舒畅|你将真气逼入体内,将全身聚集的蓝色气息|你将紫气在体内运行了一个周天|你运功完毕,站了起来|你一个周天行将下来,精神抖擞的站了起来|你分开双手,黑气慢慢沉下|你将内息走满一个周天,只感到全身通泰|你真气在体内运行了一个周天,冷热真气收于丹田|你真气在体内运行了一个周天,缓缓收气于丹田|你双眼微闭,缓缓将天地精华之气吸入体内|你慢慢收气,归入丹田,睁开眼睛|你将内息又运了一个小周天,缓缓导入丹田|你感觉毒素越转越快,就快要脱离你的控制了!|你将周身内息贯通经脉,缓缓睁开眼睛,站了起来|你呼翕九阳,抱一含元,缓缓睁开双眼|你吸气入丹田,真气运转渐缓,慢慢收功|你将真气在体内沿脉络运行了一圈,缓缓纳入丹田|你将内息在体内运行十二周天,返回丹田|你将内息走了个小周天,流回丹田,收功站了起来|过了片刻,你已与这大自然融合在一起,精神抖擞的站了起|你感到自己和天地融为一体,全身清爽如浴春风,忍不住舒畅的呻吟了一声,缓缓睁开了眼睛)','','dmlNeiliCheck')
  50.         SetTriggerOption('dmldazuo1','group','dmldazuo')
  51.         EnableTriggerGroup('dmldazuo',false)
  52.     DeleteTriggerGroup('dmlask')                                                                    
  53.         create_trigger_t('dmlask1','^(> )*老仆说道:「你还是明天再来吧。」','','dmlOver')
  54.         create_trigger_t('dmlask2','^(> )*老仆说道:「你(精血|内力)不足,如何全力一战?」','','dmlHpCheck')
  55.         create_trigger_t('dmlask3','^(> )*老仆咪咪笑着闪过身子,你觉得神志恍惚……','','dmlAskOk')
  56.         create_trigger_t('dmlask4','^(> )*如梦如醉之间,发现你已经在一所亭台之中,老仆已不知哪里去了','','dmlAskOk')
  57.         for i = 1,4 do SetTriggerOption("dmlask" .. i,"group","dmlask") end                                 
  58.         EnableTriggerGroup('dmlask',false)
  59.         DeleteTriggerGroup('dmltopcheck')
  60.         create_trigger_t('dmltopcheck3','^>*\\s*\\d*:*\\s*\\S*\\s*(\\d*)\\s*(\\D*)\\((\\D*)\\)\\s*\\D*\\s*(\\d*)\\s*\\S*\\s*\\S*,'','dmlCheckToplistAct')
  61.         create_trigger_t('dmltopcheck4','^>*\\S*\\s*还剩\\s*\\d*\\s*行\\s*==\\s*\\(ENTER\\s*继续下一页,q\\s*离开,b\\s*前一页\\)\\s*\\d*:*\\s*\\S*\\s*(\\d*)\\s*(\\D*)\\((\\D*)\\)\\s*\\D*\\s*(\\d*)\\s*\\S*\\s*\\S*,'','dmlCheckToplistAct')
  62.     create_trigger_t('dmltopcheck5','^>*\\d*:*  你今天一共有五次挑战机会,现在还有\\D*次。','','dmlInfo')
  63.         create_trigger_t('dmltopcheck6','^>*\\S*\\s*还剩\\s*\\d*\\s*行\\s*==\\s*\\(ENTER\\s*继续下一页,q\\s*离开,b\\s*前一页\\)\\d*:*  你今天一共有五次挑战机会,现在还有\\D*次。','','dmlInfo')       
  64.         for i = 1,6 do SetTriggerOption("dmltopcheck" .. i,"group","dmltopcheck") end
  65.         EnableTriggerGroup('dmltopcheck',false)
  66.         DeleteTriggerGroup('dmlnofight')
  67.         create_trigger_t('dmlnofight1','^(> )*这里不准战斗,也不准打坐。','','dmlNoFightRoom')
  68.     create_trigger_t('dmlnofight2','^(> )*您先歇口气再说话吧。','','dmlAskAgain')
  69.         for i = 1,2 do SetTriggerOption("dmlnofight" .. i,"group","dmlnofight") end
  70.     DeleteTriggerGroup('dmlfight')                                                           
  71.     create_trigger_t('dmlfight1','^(> )*突然间,一个身影出在漫天蝶影之中。你定睛一看,正是(\\D*) (\\D*)\\((\\D*)\\)。','','dmlFight')
  72.         create_trigger_t('dmlfight2','^(> )*你挑战\\D*成功,获得(\\D*)点江湖声望和(\\D*)个竞技币。','','dmlSucceed')
  73.         create_trigger_t('dmlfight3','^(> )*接着一道神光笼罩着你,你的内力有部分恢复!','','dmlCheck1')
  74.         create_trigger_t('dmlfight4','^(> )*你怀疑自己也许从来就没有到过一个叫做梦蝶楼的地方。','','dmlOut')
  75.         create_trigger_t('dmlfight5','^(> )*你今天已经挑战过\\D*了。','','dmlCheckNextTarget')
  76.         create_trigger_t('dmlfight6','^(> )*你不能挑战自己!','','dmlCheckNextTarget')
  77.         create_trigger_t('dmlfight7','^(> )*没有发现一个id是\\D*的玩家。请注意在线玩家列表!','','dmlTakePlace')                 
  78.         create_trigger_t('dmlfight8','^(> )*竞技时间已过,你无法向\\D*发起挑战。','','dmlOver')
  79.         create_trigger_t('dmlfight9','^(> )*突然一道神光笼罩着你,你的精气神竟然全部恢复了!','','dmlFailed')
  80.         for i = 1,9 do SetTriggerOption('dmlfight' ..i,'group','dmlfight') end
  81.     EnableTriggerGroup('dmlfight',false)       
  82. end
  83. function dmlPkTriggers()
  84.     DeleteTriggerGroup('dmlPk')
  85.         create_triggerex_lvl('dmlPk1','^(> )*如果你要和(\\D*)\\((\\D*)\\)性命相搏,','','dmlPkAct',99)
  86.         create_triggerex_lvl('dmlPk2','^>*\\s*加油!加油!','','dmlInPk',99)
  87.         create_triggerex_lvl('dmlPk3','^>*这里没有这个人。','','dmlPkTargetNotFound',99)
  88.         create_trigger_t('dmlPk4','^>*你今天的挑战次数已用完。,'','dmlChanceOut')
  89.         create_triggerex_lvl('dmlPk5','^>*城隍庙\\s*-\\s*','','dmlPkFail',99)
  90.         create_triggerex_lvl('dmlPk6','^(> )*(\\D*)「啪」的一声倒在地上','','dmlPkSucceed',99)
  91.     create_triggerex_lvl('dmlPk7','^(> )*(\\D*)神志迷糊,脚下一个不稳,倒在地上昏了过去。','','dmlPkFaint',99)
  92.         for i = 1,7 do SetTriggerOption('dmlPk'..i,'group','dmlPk') end
  93.         DeleteTriggerGroup('dmldazuo')
  94.         create_trigger_t('dmldazuo1','^(> )*(过了片刻,你感觉自己已经将玄天无极神功|你将寒冰真气按周天之势搬运了一周|你只觉真力运转顺畅,周身气力充沛|你将纯阳神通功运行完毕|你只觉神元归一,全身精力弥漫|你将内息走了个一个周天|你将内息游走全身,但觉全身舒畅|你将真气逼入体内,将全身聚集的蓝色气息|你将紫气在体内运行了一个周天|你运功完毕,站了起来|你一个周天行将下来,精神抖擞的站了起来|你分开双手,黑气慢慢沉下|你将内息走满一个周天,只感到全身通泰|你真气在体内运行了一个周天,冷热真气收于丹田|你真气在体内运行了一个周天,缓缓收气于丹田|你双眼微闭,缓缓将天地精华之气吸入体内|你慢慢收气,归入丹田,睁开眼睛|你将内息又运了一个小周天,缓缓导入丹田|你感觉毒素越转越快,就快要脱离你的控制了!|你将周身内息贯通经脉,缓缓睁开眼睛,站了起来|你呼翕九阳,抱一含元,缓缓睁开双眼|你吸气入丹田,真气运转渐缓,慢慢收功|你将真气在体内沿脉络运行了一圈,缓缓纳入丹田|你将内息在体内运行十二周天,返回丹田|你将内息走了个小周天,流回丹田,收功站了起来|过了片刻,你已与这大自然融合在一起,精神抖擞的站了起|你感到自己和天地融为一体,全身清爽如浴春风,忍不住舒畅的呻吟了一声,缓缓睁开了眼睛)','','dmlPkNeiliCheck')
  95.         SetTriggerOption('dmldazuo1','group','dmldazuo')
  96.         create_trigger_t('pkPfm1','^(> )*你把 "pfmpfm" 设定为 "\\D*;perform\\s*(\\D*)\\s*" 成功完成。','','pkPfmSet')
  97.         SetTriggerOption('pkPfm1','group','pkPfm')
  98. end
  99. function dmlTriggersRemove()
  100.     DeleteTriggerGroup("dmlXueAsk")
  101.     DeleteTriggerGroup("dmlXueAccept")
  102.     DeleteTriggerGroup("dmlXueTeach")
  103.     DeleteTriggerGroup("dmlXueBusy")
  104.         DeleteTriggerGroup('dmldazuo')
  105.         DeleteTriggerGroup('dmldazuo2')
  106.         DeleteTriggerGroup('dmlforce')
  107.         DeleteTriggerGroup('dmlask')
  108.         DeleteTriggerGroup('dmlfight')
  109.         DeleteTriggerGroup('dmltopcheck')
  110.         DeleteTriggerGroup('dmlnofight')
  111. end
  112. function dmlPkTriggersRemove()
  113.     pkList = {}
  114.         exe('nick none')
  115.         DeleteTriggerGroup('dmlPk')
  116. end

  117. ----------------------------------------------------------------------------------------------------准备模块一:状态查询----------------------------------------------------------------------------------------------------


  118. function dml_on()
  119.     dmlFightCnt = 0
  120.         l_cnt = 0
  121.     dmlCheckCnt = 0
  122.     dmlsucceedCnt = 0
  123.     dmlPrestige = 0
  124.     dmlCompetitionCoin = 0
  125.         blackList = {}
  126.         pkList = {}
  127.         target = {}
  128.         _target = {}
  129.         backupList = {}
  130. end
  131. function dmlModeSet()
  132.         local l_result
  133.         l_result = utils.inputbox ("PK功能暂未开放!\n\n选项一:无脑刷分模式              请输入数字 1\n\n选项二:晋级模式                  请输入数字 2\n\n模式三:玩家自定义模式            请输入数字 3\n\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlMode 变量进行修改。", "选择蝶梦楼挑战模式", GetVariable("dmlMode"), "宋体" , "12")
  134.         SetVariable('dmlMode',l_result)
  135.         return dml_check()
  136. end
  137. function dmlSettings()
  138.     local l_result
  139.         l_result = utils.inputbox ("初始挑战目标的等级上限是你的等级加上__级?\n\n请在下方空白处填写需要的数字\n\n例如你自身等级是500级,想要挑战不高于550级的目标,则请填写数字 50\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlIncreaseLvl 进行修改。", "初始挑战范围等级上限", GetVariable("dmlIncreaseLvl"), "宋体" , "12")
  140.         SetVariable('dmlIncreaseLvl',l_result)
  141.         l_result = utils.inputbox ("初始挑战目标的等级下限是你的等级减去__级?\n\n请在下方空白处填写需要的数字\n\n例如你自身等级是500级,想要挑战不低于480级的目标,则请填写数字 20\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlDecreaseLvl 进行修改。 ", "初始挑战范围等级下限", GetVariable("dmlDecreaseLvl"), "宋体" , "12")
  142.         SetVariable('dmlDecreaseLvl',l_result)
  143.         l_result = utils.inputbox ("备用列表查询等级上限提高__级?\n\n请在下方空白处填写需要的数字\n\n例如初始等级上限是550级,查询不到足够的目标想提高至600级,则填写数字 50\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlNewIncreaseLvl 进行修改。", "备用列表挑战范围等级上限", GetVariable("dmlNewIncreaseLvl"), "宋体" , "12")
  144.         SetVariable('dmlNewIncreaseLvl',l_result)
  145.         l_result = utils.inputbox ("备用列表查询等级下限降低__级?\n\n请在下方空白处填写需要的数字\n\n例如初始等级下限是480级,查询不到足够的目标想降低至450级,则填写数字 30\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlNewDecreaseLvl 进行修改。", "备用列表挑战范围等级下限", GetVariable("dmlNewDecreaseLvl"), "宋体" , "12")
  146.         SetVariable('dmlNewDecreaseLvl',l_result)
  147.         l_result = utils.inputbox ("优先挑战高于玩家排名请输入 上\n\n优先挑战低于玩家排名请输入 下\n\n不区分排名上下请输入 both\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlFightOrder 进行修改。", "挑战排名顺序指定", GetVariable("dmlFightOrder"), "宋体" , "12")
  148.         SetVariable('dmlFightOrder',l_result)
  149.         l_result = utils.inputbox ("需要重复挑战同一目标请输入 yes\n\n不需要重复挑战请输入 no\n\n注意请以小写字母输入。\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlPerTargetTwice 进行修改。", "是否对同一目标进行重复挑战", GetVariable("dmlPerTargetTwice"), "宋体" , "12")
  150.         SetVariable('dmlPerTargetTwice',l_result)
  151. --        l_result = utils.inputbox ("是否需要在蝶梦楼挑战完后自动PK挑战成功的玩家?\n\n是请输入 yes,否请输入no\n\n注意请以小写字母输入。\n\n如下次需要调整请在游戏窗口按下Ctrl + Shift + 7组合键,找到 dmlPkFlag 进行修改。\n\n此功能暂不开放!", "选择是否开启自动PK", GetVariable("dmlPkFlag"), "宋体" , "12")
  152.         SetVariable('dmlPkFlag','notReady')
  153.         return dml_check()
  154. end
  155. function dml_check()
  156.         if not GetVariable('dmlMode') then
  157.            return dmlModeSet()
  158.         else
  159.            if tonumber(GetVariable('dmlMode')) == 3 and (not GetVariable('dmlIncreaseLvl') or not GetVariable('dmlDecreaseLvl') or not GetVariable('dmlNewIncreaseLvl') or not GetVariable('dmlNewDecreaseLvl') or not GetVariable('dmlFightOrder') or not GetVariable('dmlPerTargetTwice') or not GetVariable('dmlPkFlag')) then
  160.               return dmlSettings()
  161.        end
  162.         end
  163.         DeleteTimer('idle')
  164.         dmlTriggers()
  165.         exe('hp')
  166.         print('蝶梦楼全自动挑战模块已启动.........')
  167.         messageShow('蝶梦楼全自动模块:本日蝶梦楼备战中.........','yellow','black')
  168.         if hp.food < 40 or hp.water < 40 then
  169.            return go(dmlEat,'武当山','茶亭')
  170.         else
  171.            return dmlHpCheck()
  172.         end
  173. end
  174. function dmlNoFightRoom()
  175.     return go(dmlNeili,'扬州城','莲性寺白塔')
  176. end
  177. function dmlEat()
  178.     if locl.room == '茶亭' then
  179.            exe('sit chair;knock table;get tao;#3(eat tao);get cha;#3(drink cha);drop cha;drop tao;hp')
  180.            return checkTop(dmlHpCheck)
  181.         else
  182.            return go(dmlEat,'武当山','茶亭')
  183.     end               
  184. end
  185. function dmlHpCheck()
  186.     exe('hp;cond')
  187.         if vippoison == 1 then
  188.            return go(dmlPoison,'扬州城','当铺')
  189.         else
  190.            return dmlHpCheck2()
  191.         end
  192. end
  193. function dmlPoison()
  194.     if locl.room == '当铺' then
  195.        exe('duihuan bingchan')
  196.            return check_busy(dmlXidu)
  197.         else
  198.            return go(dmlPoison,'扬州城','当铺')
  199.         end
  200. end
  201. function dmlXidu()
  202.     exe('xidu')
  203.         return checkTop(dmlHpCheck2)
  204. end
  205. function dmlHpCheck2()
  206.     if hp.jingxue_per < 100 or hp.qixue_per < 100 then
  207.            return go(dmlHeal,'柳宗镇','正厅')
  208.         else
  209.            return dmlNeili()
  210.         end
  211. end
  212. function dmlHeal()
  213.     exe('nick 柳宗镇正厅与薛神医论道')
  214.         tmp.xueSkills={}
  215.         tmp.xueCount=1
  216.         for p in pairs(skills) do
  217.                 if skills[p].lvl > 100 then
  218.                         table.insert(tmp.xueSkills,p)
  219.                 end
  220.         end
  221.         EnableTriggerGroup('dmlXueAsk',true)
  222.     EnableTriggerGroup("dmlXueBusy",true)
  223.         exe('ask xue muhua about 疗伤')
  224. end
  225. function dmlXueBusy()
  226.     return check_busy(dmlXueOk,0.4)
  227. end
  228. function dmlXueOk()
  229.     EnableTriggerGroup("dmlXueAccept",true)
  230.     exe('ask xue muhua about 疗伤')
  231. end
  232. function dmlXueAccept()
  233.     EnableTriggerGroup("dmlXueAsk",false)
  234.     EnableTriggerGroup("dmlXueAccept",true)
  235. end
  236. function dmlXueWait()
  237.     EnableTrigger("dmlXueAccept1",false)
  238.     EnableTrigger("dmlXueAccept3",false)
  239.     EnableTrigger("dmlXueAccept4",false)
  240. end
  241. function dmlXueTeach()
  242.     EnableTrigger("dmlXueAccept1",false)
  243.     EnableTriggerGroup("dmlXueAccept",false)
  244.     EnableTriggerGroup("dmlXueTeach",true)
  245.     if tmpxueskill then
  246.        for i=1,10 do
  247.            exe('teach xue '.. tmpxueskill)
  248.        end
  249.     else
  250.        for i=1,10 do
  251.            exe('teach xue '.. tmp.xueSkills[tmp.xueCount])
  252.        end
  253.     end
  254.        wait.make(function()
  255.             wait.time(0.5)
  256.                  return check_busy(dmlXueOk)
  257.        end)
  258. end
  259. function dmlXueNext()
  260.     EnableTriggerGroup("dmlXueTeach",false)
  261.     if tmpxueskill then
  262.        tmpxueskill = nil
  263.        tmp.xueCount = 0
  264.     end
  265.     tmp.xueCount = tmp.xueCount + 1
  266.     if tmp.xueCount>table.getn(tmp.xueSkills) then
  267.        return checkTop(dmlNeili)
  268.     else
  269.        return checkWait(dmlXueTeach,0.2)
  270.     end
  271. end
  272. function dmlXueHeal()
  273.     EnableTriggerGroup("dmlXueAccept",false)
  274.     DeleteTriggerGroup("dmlXueAsk")
  275.     DeleteTriggerGroup("dmlXueAccept")
  276.     DeleteTriggerGroup("dmlXueTeach")
  277.     DeleteTriggerGroup("dmlXueBusy")
  278.         exe('hp')
  279.     return dmlNeili()
  280. end
  281. function dmlNeiliCheck()
  282.     exe('yun qi;hp')
  283.         return checkWait(dmlNeili,0.2)
  284. end
  285. function dmlNeili()
  286.     if locl.room == '莲性寺白塔' then
  287.        exe('yun qi;yun jing;yun jingli')
  288.        if hp.neili < hp.neili_max * 1.5 then
  289.           return dmlDazuo()
  290.        else
  291.               exe('yun qi;nick 蝶梦楼查询目标中')
  292.               return checkWait(checkTop(dmlCheckToplist),5)
  293.            end
  294.         else
  295.            return go(dmlNeili,'扬州城','莲性寺白塔')
  296.         end
  297. end
  298. function dmlDazuo()
  299.         EnableTriggerGroup('dmldazuo',true)
  300.         exe('yun qi;dazuo '..hp.dazuo)
  301. end
  302. function checkTop(func)
  303.         disWait()
  304.         DeleteTriggerGroup("checkTop")
  305.         create_trigger_t('checkTop1',"^(> )*(你现在已经组合|你已准备有一种技能了|你至少不会这两种拳脚技能的其中之一)",'','beiOk')
  306.         create_trigger_t('checkTop2',"^(> )*你现在没有激发任何有效特殊技能。",'','beiNone')
  307.         SetTriggerOption("checkTop1","group","checkTop")
  308.         SetTriggerOption("checkTop2","group","checkTop")
  309.         EnableTriggerGroup("checkTop",true)
  310.         EnableTrigger("hp12",true)
  311.         beihook = func         
  312.         exe('bei bei bei')
  313.         return beiTimer()
  314. end
  315. function beiTimer()
  316.     return create_timer_s('bei',0.5,'beiTimerSet')
  317. end
  318. function beiTimerSet()
  319.     exe('bei bei bei')
  320. end
  321. function beiNone()
  322.     for p,q in pairs(skillEnable) do
  323.        if skills[p] and q ~= "force" then
  324.           exe('jifa '..q..' '..p)
  325.                   if math.random(1,3) == 1 then
  326.                      break
  327.                   end
  328.            end
  329.     end
  330. end
  331. function beiOk()
  332.     EnableTriggerGroup("checkTop",false)
  333.         EnableTrigger("hp12",false)
  334.         EnableTimer('bei',false)
  335.         if beihook == nil then
  336.            beihook = checkTopDone
  337.         end
  338.     return beihook()
  339. end
  340. function checkTopDone()
  341.     ColourNote('fuchsia','black','topPk列表查询完毕!')
  342. end

  343. ---------------------------------------------------------------------------------------------------准备模块二:查询目标---------------------------------------------------------------------------------------------------


  344. function sortFunc(a,b)
  345.         if a.lvl ~= b.lvl then
  346.            return a.lvl > b.lvl
  347.         else
  348.            if a.rank ~= b.rank then
  349.               return a.rank < b.rank
  350.            end
  351.         end
  352. end
  353. function dmlCheckToplist()
  354.         DeleteTimer('dmlWait')
  355.         create_timer_s('dmlWait',10,'dmlWait')
  356.     EnableTriggerGroup('dmltopcheck',true)
  357.     EnableTriggerGroup('dmlask',false)
  358.     dmlCheckCnt = dmlCheckCnt + 1
  359.         if tonumber(GetVariable('dmlMode')) ~= 3 then
  360.            SetVariable('dmlDecreaseLvl',20)
  361.            SetVariable('dmlIncreaseLvl',50)
  362.            SetVariable('dmlNewDecreaseLvl',20)
  363.            SetVariable('dmlNewIncreaseLvl',50)
  364.            SetVariable('dmlPkFlag','notReady')
  365.         end
  366.         target = {}
  367.         _target = {}
  368.         backupList = {}
  369.         exe('top pk 999')
  370.         checkTop(checkTop)
  371. end
  372. function dmlCheckToplistAct(n,l,w)
  373.         targetRank = tonumber(w[1])
  374.         targetName = tostring(w[2])
  375.         targetId = string.lower(w[3])
  376.         targetLvl = tonumber(w[4])
  377.         table.insert(_target,{name = targetName,id = targetId,rank = targetRank, lvl = targetLvl,})
  378.         if string.find(score.id,targetId) then
  379.            userRank = targetRank
  380.            userLvl = targetLvl
  381.            messageShow('玩家当前蝶梦楼【排名】'..userRank..'位|【等级】'..userLvl..'级','gold')
  382.         end
  383. end
  384. function dmlInfo()
  385.     local fn = 'logs\\diemenglou_lost_'..score.id..'.log'
  386.         local f = io.open(fn,"r")
  387.         if f then
  388.            local s = f:read()
  389.        local avoid
  390.            avoid = utils.split(s,'|')
  391.            for n = 1,table.getn(_target) do
  392.               for k,v in pairs(avoid) do
  393.                      if _target[n] ~= nil and _target[n].name == avoid[k] then
  394.                     if _target[avoid[k]] == nil then
  395.                            _target[avoid[k]] = 1
  396.                                    ColourNote('white','red','上次挑战目标【'.._target[n].name..'】失败【'.._target[avoid[k]]..'】次!')
  397.                         else
  398.                            _target[avoid[k]] = _target[avoid[k]] + 1
  399.                                    ColourNote('white','red','上次挑战目标【'.._target[n].name..'】失败【'.._target[avoid[k]]..'】次!')
  400.                         end
  401.                     if _target[avoid[k]] > 1 then
  402.                                ColourNote('white','red','移除目标【'.._target[n].name..'】')
  403.                                    messageShow('蝶梦楼全自动挑战模块:因与目标【'.._target[n].name..'】对战成功率过低现自动回避该目标!')
  404.                                table.remove(_target,n)
  405.                             end
  406.                          end
  407.                   end
  408.            end
  409.         f:close()
  410.         end
  411.     if dmlCheckCnt == 1 then
  412.            _t1 = userLvl - GetVariable('dmlDecreaseLvl')
  413.            _t2 = userLvl + GetVariable('dmlIncreaseLvl')
  414.         else
  415.            _t1 = userLvl - (GetVariable('dmlDecreaseLvl') + GetVariable('dmlNewDecreaseLvl'))
  416.            _t2 = userLvl + (GetVariable('dmlIncreaseLvl') + GetVariable('dmlNewIncreaseLvl'))
  417.         end
  418.     table.sort(_target,sortFunc)
  419.     if tonumber(GetVariable('dmlMode')) == 1 then
  420.            for i = 1,table.getn(_target) do
  421.                    if _target[i].lvl > _t1  and _target[i].id ~= score.id then
  422.               DeleteTimer('dmlWait')
  423.                           table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  424.                           table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  425.                    end
  426.            end
  427.            ColourNote('doggerblue','black','挑战目标排名等级为','yellow','black','【'.._t1..'】','doggerblue','black','级之上')
  428.         elseif tonumber(GetVariable('dmlMode')) == 2 then
  429.            for i = 1,table.getn(_target) do
  430.                    if _target[i].lvl > _t1 and _target[i].id ~= score.id then
  431.               DeleteTimer('dmlWait')
  432.                           table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  433.                    end
  434.            end
  435.            ColourNote('doggerblue','black','挑战目标排名等级为','yellow','black','【'.._t1..'】','doggerblue','black','级之上')
  436.     elseif tonumber(GetVariable('dmlMode')) == 3 then
  437.            if GetVariable('dmlPerTargetTwice') == 'no' then
  438.               if GetVariable('dmlFightOrder') == '上' then
  439.                      for i = 1,table.getn(_target) do
  440.                             if _target[i].rank < userRank then
  441.                            if _target[i].lvl > _t1 and _target[i].lvl < _t2 and _target[i].id ~= score.id then
  442.                       DeleteTimer('dmlWait')
  443.                                   table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  444.                            end
  445.                                    if _target[i].lvl > _t1 - GetVariable('dmlDecreaseLvl') and _target[i].lvl < _t2 + GetVariable('dmlIncreaseLvl') then
  446.                                       table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  447.                                    end
  448.                                 end
  449.                  end
  450.                   elseif GetVariable('dmlFightOrder') == '下' then
  451.                      for i = 1,table.getn(_target) do
  452.                             if _target[i].rank > userRank then
  453.                            if _target[i].lvl > _t1 and _target[i].lvl < _t2 and _target[i].id ~= score.id then
  454.                       DeleteTimer('dmlWait')
  455.                                   table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  456.                            end
  457.                                    if _target[i].lvl > _t1 - GetVariable('dmlDecreaseLvl') and _target[i].lvl < _t2 + GetVariable('dmlIncreaseLvl') and _target[i].id ~= score.id then
  458.                                       table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  459.                                    end
  460.                                 end
  461.                  end
  462.                   elseif GetVariable('dmlFightOrder') == 'both' then
  463.                      for i = 1,table.getn(_target) do
  464.                         if _target[i].lvl > _t1 and _target[i].lvl < _t2 and _target[i].id ~= score.id then
  465.                    DeleteTimer('dmlWait')
  466.                                table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  467.                         end
  468.                                 if _target[i].lvl > _t1 - GetVariable('dmlDecreaseLvl') and _target[i].lvl < _t2 + GetVariable('dmlIncreaseLvl') and _target[i].id ~= score.id then
  469.                                    table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  470.                                 end
  471.                  end
  472.                   end
  473.            elseif GetVariable('dmlPerTargetTwice') == 'yes' then
  474.               if GetVariable('dmlFightOrder') == '上' then
  475.                      for i = 1,table.getn(_target) do
  476.                             if _target[i].rank < userRank then
  477.                            if _target[i].lvl > _t1 and _target[i].lvl < _t2 and _target[i].id ~= score.id then
  478.                       DeleteTimer('dmlWait')
  479.                                   table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  480.                                           table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  481.                            end
  482.                                    if _target[i].lvl > _t1 - GetVariable('dmlDecreaseLvl') and _target[i].lvl < _t2 + GetVariable('dmlIncreaseLvl') and _target[i].id ~= score.id then
  483.                                       table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  484.                                           table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  485.                                    end
  486.                                 end
  487.                  end
  488.                   elseif GetVariable('dmlFightOrder') == '下' then
  489.                      for i = 1,table.getn(_target) do
  490.                             if _target[i].rank > userRank then
  491.                            if _target[i].lvl > _t1 and _target[i].lvl < _t2 and _target[i].id ~= score.id then
  492.                       DeleteTimer('dmlWait')
  493.                                   table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  494.                                           table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  495.                            end
  496.                                    if _target[i].lvl > _t1 - GetVariable('dmlDecreaseLvl') and _target[i].lvl < _t2 + GetVariable('dmlIncreaseLvl') and _target[i].id ~= score.id then
  497.                                       table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  498.                                           table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  499.                                    end
  500.                                 end
  501.                  end
  502.                   elseif GetVariable('dmlFightOrder') == 'both' then
  503.                      for i = 1,table.getn(_target) do
  504.                         if _target[i].lvl > _t1 and _target[i].lvl < _t2 and _target[i].id ~= score.id then
  505.                    DeleteTimer('dmlWait')
  506.                                table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  507.                                    table.insert(target,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  508.                         end
  509.                                 if _target[i].lvl > _t1 - GetVariable('dmlDecreaseLvl') and _target[i].lvl < _t2 + GetVariable('dmlIncreaseLvl') and _target[i].id ~= score.id then
  510.                                    table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  511.                                    table.insert(backupList,{name = _target[i].name,id = _target[i].id,rank = _target[i].rank, lvl = _target[i].lvl,})
  512.                                 end
  513.                  end
  514.                   end
  515.        end
  516.            ColourNote('doggerblue','black','挑战目标排名等级为','yellow','black','【'.._t1..'】','doggerblue','black','级到','yellow','black','【'.._t2..'】','doggerblue','black','级之间')
  517.         end
  518.         if table.getn(blackList) > 0 then
  519.            for i = 1,table.getn(target) do
  520.                   for p,q in pairs(blackList) do
  521.                          if target[i] ~= nil then
  522.                                 if string.find(target[i].id,blackList[p]) then
  523.                                    table.remove(target,i)
  524.                                 end
  525.                      end
  526.                   end
  527.            end
  528.            for j = 1,table.getn(backupList) do
  529.                   for m,n in pairs(blackList) do
  530.                          if backupList[j] ~= nil then
  531.                                 if string.find(backupList[j].id,blackList[m]) then
  532.                                    table.remove(backupList,j)
  533.                                 end
  534.                      end
  535.                   end
  536.            end
  537.         end
  538.         return dmlConsider()
  539. end
  540. function dmlConsider()
  541.         if dmlCheckCnt < 3 then
  542.            if table.getn(target) < 5 then
  543.           if table.getn(backupList) < 5 then
  544.              ColourNote('red','black','可挑战目标数量不足,变更条件再次查询!')
  545.                  return checkWait(dmlCheckToplist,5)                         
  546.           else
  547.                      if tonumber(GetVariable('dmlMode')) == 1 or GetVariable('dmlPerTargetTwice') == 'yes' then
  548.                             ColourNote('lime','black','共查询到【'..(table.getn(backupList) / 2)..'】位符合条件的目标')
  549.                                 messageShow('蝶梦楼全自动模块:共查询到【'..(table.getn(backupList) / 2)..'】位符合条件的目标.........','lime','black')
  550.                                 for i = table.getn(backupList),(table.getn(backupList) - 4),-1 do
  551.                        ColourNote('lime','black','挑战目标名称','white','black','【'..backupList[i].name..'】','lime','black',' 目标ID','white','black','【'..backupList[i].id..'】','lime','black',' 目标排名','white','black','【'..backupList[i].rank..'】','lime','black','位 目标等级','white','black','【'..backupList[i].lvl..'】','lime','black','级。')
  552.                     end
  553.                      else
  554.                             ColourNote('lime','black','共查询到【'..table.getn(backupList)..'】位符合条件的目标')
  555.                                 messageShow('蝶梦楼全自动模块:共查询到【'..table.getn(backupList)..'】位符合条件的目标.........','lime','black')
  556.                                 for i = table.getn(backupList),(table.getn(backupList) - 4),-1 do
  557.                        ColourNote('lime','black','挑战目标名称','white','black','【'..backupList[i].name..'】','lime','black',' 目标ID','white','black','【'..backupList[i].id..'】','lime','black',' 目标排名','white','black','【'..backupList[i].rank..'】','lime','black','位 目标等级','white','black','【'..backupList[i].lvl..'】','lime','black','级。')
  558.                     end
  559.                          end
  560.                      l_cnt = table.getn(backupList)
  561.                   end
  562.            else
  563.               if tonumber(GetVariable('dmlMode')) == 1 or GetVariable('dmlPerTargetTwice') == 'yes' then
  564.                          ColourNote('lime','black','共查询到【'..(table.getn(target) / 2)..'】位符合条件的目标')
  565.                          messageShow('蝶梦楼全自动模块:共查询到【'..(table.getn(target) / 2)..'】位符合条件的目标.........','lime','black')
  566.                          for i = table.getn(target),(table.getn(target) - 4),-1 do
  567.                     ColourNote('lime','black','挑战目标名称','white','black','【'..target[i].name..'】','lime','black',' 目标ID','white','black','【'..target[i].id..'】','lime','black',' 目标排名','white','black','【'..target[i].rank..'】','lime','black','位 目标等级','white','black','【'..target[i].lvl..'】','lime','black','级。')
  568.                  end
  569.                   else
  570.                          ColourNote('lime','black','共查询到【'..table.getn(target)..'】位符合条件的目标')
  571.                          messageShow('蝶梦楼全自动模块:共查询到【'..table.getn(target)..'】位符合条件的目标.........','lime','black')
  572.                          for i = table.getn(target),(table.getn(target) - 4),-1 do
  573.                     ColourNote('lime','black','挑战目标名称','white','black','【'..target[i].name..'】','lime','black',' 目标ID','white','black','【'..target[i].id..'】','lime','black',' 目标排名','white','black','【'..target[i].rank..'】','lime','black','位 目标等级','white','black','【'..target[i].lvl..'】','lime','black','级。')
  574.                  end
  575.                   end
  576.                   l_cnt = table.getn(target)
  577.            end
  578.            return checkTop(dmlAsk)
  579.         else
  580.            messageShow('蝶梦楼全自动模块:已到达查询上限,没有符合条件的目标,请手动检查或修改条件重新开始.........','white','red')
  581.        return dmlOver()
  582.     end
  583. end
  584. function dmlWait()
  585.     DeleteTimer('dmlWait')
  586.     ColourNote('red','black','没有查询到任何目标,变更条件再次查询!')
  587.         checkWait(dmlCheckToplist,5)
  588. end

  589. ----------------------------------------------------------------------------------------------------蝶梦楼挑战开始----------------------------------------------------------------------------------------------------


  590. function dmlSucceed(n,l,w)
  591.     local l_prestige = 0
  592.         local l_competitionCoin = 0
  593.         local _cnt = l_cnt + 1
  594.         if table.getn(target) >= 5 then
  595.            messageShow('挑战【'..target[_cnt].name..'】 【'..target[_cnt].id..'】成功!','lime','black')
  596.            table.insert(pkList,{name = target[_cnt].name,id = target[_cnt].id,})
  597.         else
  598.            messageShow('挑战【'..backupList[_cnt].name..'】 【'..backupList[_cnt].id..'】成功!','lime','black')
  599.            table.insert(pkList,{name = backupList[_cnt].name,id = backupList[_cnt].id,})
  600.         end
  601.         l_prestige = tonumber(trans(w[2]))
  602.     l_competitionCoin = tonumber(trans(w[3]))
  603.     dmlsucceedCnt = dmlsucceedCnt + 1
  604.         dmlPrestige = dmlPrestige + l_prestige
  605.         dmlCompetitionCoin = dmlCompetitionCoin + l_competitionCoin
  606. end
  607. function dmlFailed()
  608.     CloseLog()
  609.         local _cnt = l_cnt + 1
  610.         local fn = 'logs\\diemenglou_lost_'..score.id..'.log'
  611.         local f = io.open(fn,"a")
  612.         if table.getn(target) >= 5 then
  613.            local s = target[_cnt].name..'|'
  614.            messageShow('挑战【'..target[_cnt].name..'】 【'..target[_cnt].id..'】失败!','fuchsia','black')
  615.            table.insert(pkList,{name = target[_cnt].name,id = target[_cnt].id,})
  616.         else
  617.            local s = backupList[_cnt].name..'|'
  618.            messageShow('挑战【'..backupList[_cnt].name..'】 【'..backupList[_cnt].id..'】失败!','fuchsia','black')
  619.            table.insert(pkList,{name = backupList[_cnt].name,id = backupList[_cnt].id,})
  620.         end
  621.         f:write(s)
  622.     f:close()
  623. end
  624. function dmlCheckNextTarget()
  625.     if table.getn(target) >= 5 then
  626.            table.insert(blackList,target[l_cnt].id)
  627.         else
  628.            table.insert(blackList,backupList[l_cnt].id)
  629.         end
  630.     l_cnt = l_cnt - 1
  631.     return dmlAsk()
  632. end
  633. function dmlAskOk()
  634.     EnableTriggerGroup('dmlask',false)
  635. end
  636. function dmlAskAgain()
  637.     return checkTop(dmlAsk)
  638. end
  639. function dmlAsk()
  640.     EnableTriggerGroup('dmltargetcheck',false)
  641.     EnableTrigger('fight2',false)                  
  642.         EnableTrigger('fight16',false)
  643.     EnableTriggerGroup('dmlask',false)
  644.     exe('ask laopu about 梦境')
  645.         checkTop(dmlAsk1)
  646. end
  647. function dmlAsk1()
  648.     EnableTriggerGroup('dmlask',true)
  649.     exe('ask laopu about 上楼')
  650.         checkTop(dmlAsk2)
  651. end
  652. function dmlAsk2()
  653.     exe('ask laopu about 上楼')
  654.         checkTop(dmlDream)
  655. end
  656. function dmlDream()
  657.     EnableTriggerGroup('dmlfight',true)
  658.         if dmlFightCnt < 5 then
  659.        if l_cnt > 0 then
  660.               if table.getn(target) >= 5 then
  661.              messageShow('蝶梦楼全自动模块:现在开始挑战【'..target[l_cnt].name..'】 【'..target[l_cnt].id..'】.........','yellow')
  662.                  return exe('dream '..target[l_cnt].id)
  663.               else
  664.              messageShow('蝶梦楼全自动模块:现在开始挑战【'..backupList[l_cnt].name..'】 【'..backupList[l_cnt].id..'】.........','yellow')
  665.                  return exe('dream '..backupList[l_cnt].id)
  666.               end
  667.            else
  668.               ColourNote('red','black','列表剩余目标不足,变更条件再次查询!')
  669.               return checkWait(dmlCheckToplist,5)
  670.            end
  671.         else
  672.            return dmlOver()
  673.         end
  674. end
  675. function dmlTakePlace()
  676.     return checkWait(dmlTopTake,5)
  677. end
  678. function dmlTopTake()
  679.     if table.getn(target) >= 5 then
  680.        if target[l_cnt].rank < userRank then
  681.           exe('top take '..target[l_cnt].rank)
  682.               userRank = target[l_cnt].rank
  683.               print('目标【'..target[l_cnt].name..'】离线,取代对方排名【'..target[l_cnt].rank..'】位')
  684.               messageShow('蝶梦楼全自动模块:挑战目标【'..target[l_cnt].name..'】离线,取代对方排名至【'..target[l_cnt].rank..'】位.........','lime')
  685.               table.insert(blackList,target[l_cnt].id)
  686.            end
  687.         else
  688.            if backupList[l_cnt].rank < userRank then
  689.           exe('top take '..backupList[l_cnt].rank)
  690.               userRank = backupList[l_cnt].rank
  691.               print('目标【'..blackList[l_cnt].name..'】离线,取代对方排名【'..blackList[l_cnt].rank..'】位')
  692.               messageShow('蝶梦楼全自动模块:挑战目标【'..blackList[l_cnt].name..'】离线,取代对方排名至【'..blackList[l_cnt].rank..'】位.........','lime')
  693.               table.insert(blackList,backupList[l_cnt].id)
  694.            end
  695.         end
  696.         l_cnt = l_cnt - 1
  697.     if l_cnt > 0 then
  698.            messageShow('蝶梦楼全自动模块:挑战目标【'..target[(l_cnt + 1)].name..'】离线,继续挑战下一目标.........','lime')
  699.        return checkTop(dmlAsk)
  700.         else
  701.            ColourNote('red','black','变更条件再次查询!')
  702.            return checkWait(dmlCheckToplist,5)
  703.         end
  704. end
  705. function dmlFight(n,l,w)
  706.     dmlFightCnt = dmlFightCnt + 1
  707.     local fn = GetInfo (67) .. "logs\" .. score.id .. '蝶梦楼竞技记录'..dmlFightCnt.. ".log"
  708.     OpenLog (fn, false)
  709.     ColourNote('Lime','black','开始写入蝶梦楼竞技记录到'..fn..',写入方式为擦除重写!')
  710.     l_cnt = l_cnt - 1
  711.     job.name = 'diemenglou'
  712.         npc_name = ''
  713.         npc_id = ''
  714.     delete_all_timers()
  715.         npc_name = w[3]
  716.         npc_id = string.lower(w[4])
  717.         exe('set wimpycmd pfmpfm\\hp')
  718.         exe('pfmwu')
  719.         exe('set wimpy 100;yield no')
  720.         exe('look '..npc_id)
  721.         exe('nick 蝶梦楼战斗中')
  722.         exe('say 那么,来一场酣畅淋漓的战斗吧!')
  723.         kezhiwugong()
  724.         kezhiwugongAddTarget(npc_name,npc_id)
  725. end
  726. function dmlCheck1()
  727.         CloseLog()
  728.     exe('hp')
  729.         return checkTop(dmlCheck2)
  730. end
  731. function dmlCheck2()
  732.     if hp.qixue_per < 95 and hp.qixue_per >= 70 and cty_cur > 0 then
  733.            exe('fu chantui yao;hp')
  734.            return checkTop(dmlCheck1)
  735.         elseif (hp.qixue_per < 100 and hp.qixue_per > 95) or cty_cur == 0 then
  736.            exe('yun heal')
  737.            return checkTop(dmlCheck1)
  738.         elseif hp.qixue_per < 70 then
  739.            return exe('wait '..score.id)
  740.         else
  741.            if l_cnt > 0 then
  742.               return checkTop(dmlAsk)
  743.        else
  744.               ColourNote('red','black','变更条件再次查询!')
  745.               return checkWait(dmlCheckToplist,5)
  746.            end
  747.         end
  748. end
  749. function dmlOut()
  750.     if dmlFightCnt < 5 then
  751.        if l_cnt > 0 then
  752.               ColourNote('violet','black','继续上楼挑战。')
  753.               return checkTop(dmlAsk)
  754.        else
  755.                   ColourNote('red','black','变更条件再次查询!')
  756.               return checkWait(dmlCheckToplist,5)
  757.            end
  758.         else
  759.            return dmlOver()
  760.         end
  761. end
  762. function dmlOver()
  763.     if dmlFightCnt == 5 then
  764.            local fn = 'logs\\diemenglou_mark_'..score.id..'.log'
  765.            local f = io.open(fn,"w")
  766.            local s = os.date("%Y%m%d%H")
  767.            if tonumber(os.date('%H')) >= 22 then
  768.               s = os.date("%Y%m%d")..'09'
  769.            end
  770.            if tonumber(os.date('%H')) < 8 then
  771.               s = tonumber(os.date("%Y%m%d")..'09') - 100
  772.            end
  773.            f:write(s)
  774.        f:close()
  775.            dmlTriggersRemove()
  776.            EnableTrigger('fight2',true)
  777.            EnableTrigger('fight16',true)
  778.            print('本日蝶梦楼可挑战次数为零,模块退出')
  779.            messageShow('蝶梦楼全自动模块:挑战成功【'..dmlsucceedCnt..'】次,获得【'..dmlPrestige..'】点声望,【'..dmlCompetitionCoin..'】点竞技币.........','gold')
  780.            messageShow('蝶梦楼全自动模块:本日蝶梦楼可挑战次数为零,模块退出.........','lime')
  781.            exe('nick none')
  782.            if GetVariable("dmlPkFlag") == 'yes' and table.getn(pkList) > 0 then
  783.               exe('unset pk_give_up')
  784.               return dmlPkFunc()
  785.            else
  786.               return checkTop(check_food)
  787.            end
  788.     else
  789.            askCnt = askCnt + 1
  790.            if askCnt > 1 then
  791.               askCnt = 0
  792.               dmlFightCnt = 5
  793.                   return dmlOver()
  794.            end
  795.         end
  796. end


  797. ----------------------------------------------------------------------------------------------------自动PK模块----------------------------------------------------------------------------------------------------


  798. function dmlPkFunc()
  799.     exe(GetVariable('pfmwu'))
  800.         exe('unset wimpycmd;jiali 0')
  801.     exe('hp')
  802.         pkCnt = 1
  803.         pkWaitCnt = 0
  804.         return(dmlPkStart)
  805. end
  806. function dmlPkStart()
  807.     if locl.room == '正气堂' then
  808.            dmlPkTriggers()
  809.            exe('yun qi;yun jing;yun jingli')
  810.            if hp.neili >= hp.neili_max * 1.5 then
  811.               return dmlPkWait()
  812.            else
  813.               return dmlPkNeili()
  814.            end
  815.         else
  816.            return go(dmlPkStart,'华山','正气堂')
  817.         end
  818. end
  819. function dmlPkNeiliCheck()
  820.     exe('hp')
  821.         checkWait(dmlPkNeili,0.2)
  822. end
  823. function dmlPkNeili()
  824.     if hp.neili < hp.neili_max * 1.5 then
  825.        return dmlPkDazuo()
  826.     else
  827.            exe('yun qi;nick 华山正气堂堵人中')
  828.            return dmlPkWait()
  829.         end
  830. end
  831. function dmlPkWait()   
  832.         if pkCnt <= table.getn(pkList) then
  833.            create_timer_s('dmlPkWait',1,'dmlPkWaitAct')
  834.         else
  835.            messageShow('蝶梦楼全自动模块:PK模块结束.........','yellow','black')
  836.            DeleteTriggerGroup("dmlPk")
  837.            kezhiwugongclose()
  838.            return check_food()
  839.         end
  840. end
  841. function dmlPkTargetNotFound()
  842.     pkWaitCnt = pkWaitCnt + 1
  843.         if pkWaitCnt > 180 then
  844.            pkWaitCnt = 0
  845.            messageShow('蝶梦楼全自动模块:超过三分钟未等到玩家【'..pkList[pkCnt].name..'】,更换下一目标。.........','yellow')
  846.            pkCnt = pkCnt + 1
  847.         end
  848. end
  849. function dmlPkAct(n,l,w)
  850.     pkWaitCnt = 0
  851.     DeleteTimer('dmlPkWait')
  852.         npc_name = w[2]
  853.         npc_id = string.lower(w[3])
  854.         exe('set wimpycmd pkHeqiCheck\\hp')
  855.         exe('set wimpy 100;yield no')
  856.         kezhiwugong()
  857.         kezhiwugongAddTarget(npc_name,npc_id)
  858.         create_timer_s('dmlPkCheck',1,'dmlPkCheck')
  859. end
  860. function dmlPkCheck()
  861.     exe('kill '..npc_id)
  862. end
  863. function dmlPkWaitAct()
  864.     if pkList.id[pkCnt] ~= nil then
  865.        exe('kill '..pkList[pkCnt].id)
  866.         else
  867.            messageShow('蝶梦楼全自动模块:PK模块结束.........','yellow')
  868.            DeleteTriggerGroup("dmlPk")
  869.            kezhiwugongclose()
  870.            return check_food()
  871.         end
  872. end
  873. function pkHeqiCheck()
  874.     DeleteTriggerGroup("hpheqi")
  875.     create_trigger_t('hpheqi1',"^·合气度·\\s*\\-?\\s*(\\d*)",'','hpHeqiCheck')
  876.     SetTriggerOption("hpheqi1","group","hpheqi")
  877. end
  878. function hpHeqiCheck(n,l,w)
  879.     local heqi = 0
  880.         heqi = tonumber(w[1])
  881.         if hp.qixue_per < 35 and dhd_cur > 0 then
  882.        exe('fu dahuan dan')
  883.     end
  884.     if hp.qixue_per < 70 and cty_cur > 0 then
  885.        exe('fu chantui yao')
  886.     end
  887.         if (hp.qixue / (hp.qixue_max / hp.qixue_per ) < 35) and cty_cur > 0 then
  888.        exe('fu chantui yao')
  889.     end
  890.     if hp.qixue < hp.qixue_max * 0.7 then
  891.        exe('yun qi')
  892.     end
  893.     if hp.jingxue < hp.jingxue_max * 0.5 then
  894.        exe('yun jing')
  895.     end
  896.         if hp.neili < hp.neili_max * 0.5 and nxw_cur > 0 then
  897.        exe('eat '.. drug.neili)
  898.     end
  899.     if hp.jingli < hp.jingli_max * 0.5 or hp.jingli < 500 then
  900.        exe('yun jingli')
  901.     end
  902.     if hp.neili < hp.neili_max * 0.5 and nxw_cur > 0 then
  903.        exe('eat '.. drug.neili)
  904.     end
  905.         if hp.qixue_per < 80 then
  906.            exe('eat '.. drug.heal)
  907.     end
  908.     if perform.force and perform.force == "dulong-dafa" and (not flag.wudi or flag.wudi == 0) then
  909.        exe('yun wudi')
  910.     end
  911.     if perform.force and perform.force == "dulong-dafa" and hp.qixue_per < 70 then
  912.        exe('yun wudi')
  913.     end
  914.         if heqi >= 840 then
  915.            create_alias('l_pkPfm','l_pkPfm','alias pfmpfm '..GetVariable('pfmsanqing'))
  916.            exe('l_pkPfm')
  917.            exe('set wimpycmd pfmpfm\\hp')
  918.         end
  919. end
  920. function pkPfmSet(n,l,w)
  921.     local subPfm = string.lower(w[2])
  922.         create_alias('pkPfm','pkPfm','alias pfmpfm perform '.. subPfm ..';perform '.. subPfm)
  923.     exe('pkPfm')
  924. end
  925. function dmlInPk()
  926.     DeleteTimer('dmlPkCheck')
  927.         pkCnt = pkCnt + 1
  928. end
  929. function dmlChanceOut()
  930.     DeleteTriggerGroup("dmlPk")
  931.     DeleteTimer('dmlPkCheck')
  932.     kezhiwugongclose()
  933.         messageShow('蝶梦楼全自动模块:PK模块结束.........','yellow')
  934.         return check_food()
  935. end
  936. function dmlPkFaint()
  937.     exe('kill '..npc_id)
  938.         return dmlPkSucceed()
  939. end
  940. function dmlPkSucceed()
  941.     messageShow('蝶梦楼全自动模块:PK玩家【'..npc_name..'】成功.........','lime')
  942.     if pkCnt - 1 < table.getn(pkList.id) then
  943.            return dmlPkStart()
  944.         else
  945.            messageShow('蝶梦楼全自动模块:PK模块结束.........','yellow')
  946.            DeleteTriggerGroup("dmlPk")
  947.            kezhiwugongclose()
  948.            return check_food()
  949.         end
  950. end
  951. function dmlPkFail()
  952.     exe('hp')
  953.         locl.room = '城隍庙'
  954.         DeleteTimer('dmlPkWait')
  955.         DeleteTimer('dmlPkCheck')
  956.     messageShow('蝶梦楼全自动模块:PK玩家【'..npc_name..'】失败.........','red')
  957.     if pkCnt - 1 < table.getn(pkList.id) then
  958.            return dmlPkStart()
  959.         else
  960.            messageShow('蝶梦楼全自动模块:PK模块结束.........','yellow')
  961.            DeleteTriggerGroup("dmlPk")
  962.            kezhiwugongclose()
  963.            return check_food()
  964.         end
  965. end
复制代码
门派:古墓派
发表于 2018-11-2 12:26:59 来自手机 | 显示全部楼层
为啥升级完后 不启动碟梦搂模块了?
门派:姑苏慕容
发表于 2018-11-2 12:32:49 | 显示全部楼层
大神终于又更新了,这两天经常卡住
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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