找回密码
 注册
搜索
查看: 209|回复: 9

ts2公版添加明教巡逻模块

[复制链接]
门派:古墓派
发表于 2024-6-7 15:36:15 | 显示全部楼层 |阅读模式
本帖最后由 dbm@ts2 于 2024-6-7 22:45 编辑

1、讲巡逻添加到了任务列表,iset可以选择
2、出了九阳提示,自动在窗口提示,并在log文件夹中添加一个文件记录

比较小众,有问题留言

一、shujian.lua
替换以下函数

  1. function checkJoblast(n,l,w)
  2.     local joblast = {
  3.                 ["武当锄奸"] = "wudang",
  4.                 ["大理送信"] = "songxin",
  5.                 ["强抢美女"] = "xueshan",
  6.                 ["惩恶扬善"] = "huashan",
  7.                 ["长乐帮"]   = "clb",
  8.                 ["天地会"]   = "tdh",
  9.                 ["嵩山并派"] = "songshan",
  10.                 ["丐帮任务"] = "gaibang",
  11.                 ["颂摩崖抗敌任务"] = "songmoya",
  12.                 ["明教巡逻"] = "mjxunluo",         
  13.     }

  14.     if joblast[w[2]] then
  15.        job.last = joblast[w[2]]
  16.     end
  17. end
复制代码

  1. function check_job()
  2.     job_exp_tongji()
  3.   if score.party=='明教' and job.zuhe["mjxunluo"] then ---xunluo
  4.          return check_halt(weaponUcheck)
  5.    end
  6.    if hp.exp<1000000 then
  7.       print('巡城到1M')
  8.       kdummy=0
  9.       return xunCheng()
  10.    end
  11.    if score.party=="桃花岛" and (hp.shen>150000 or hp.shen<-150000) then
  12.       return thdJiaohui()
  13.    end
  14.    if condition.busy and condition.busy > 10 then
  15.       return check_halt(weaponUcheck)
  16.    end
  17.    if job.last=="xueshan" or job.last=="wudang" or job.last=="songxin" or hsruntime~=0 then
  18.           return check_halt(check_jobx)--雪山、武当任务结束后不检查武器状态,直接做下一个任务。
  19.         else
  20.       return check_halt(weaponUcheck)
  21.    end
  22. end
复制代码

  1. function check_jobx()
  2. for p in pairs(weaponUsave) do
  3.            if Bag and not Bag[p] then
  4.               job.zuhe["songmoya"]=nil
  5.            end
  6.    end
  7. if fqyytmp.goArmorD==1 then
  8.        return fqyyArmorGoCheck()       
  9. end
  10.    if job.zuhe==nil then job.zuhe={} end
  11.    if job.zuhe["zhuoshe"] and score.party~="丐帮" then job.zuhe["zhuoshe"]=nil end
  12.    if job.zuhe["mjxunluo"] and score.party~="明教" then job.zuhe["mjxunluo"]=nil end
  13.    if job.zuhe["sldsm"] and score.party~="神龙教" then job.zuhe["sldsm"]=nil end
  14.    if job.zuhe["songmoya"] and hp.exp<5000000 then job.zuhe["songmoya"]=nil end
  15.    if smydie*1>=smyall*1 then job.zuhe["songmoya"]=nil end
  16.    if job.zuhe["husong"] and (score.party~="少林派" or hp.exp<2000000) then job.zuhe["husong"]=nil end
  17.    if job.zuhe["songmoya"] and job.last~="songmoya" and mytime<=os.time() then return songmoya() end
  18.    if job.zuhe["hubiao"] and job.last~="hubiao" and job.teamname and ((not condition.hubiao) or (condition.hubiao and condition.hubiao<=0)) then
  19.       return hubiao()
  20.    elseif job.zuhe["husong"] then
  21.       return husong()
  22.    elseif job.zuhe["mjxunluo"] then
  23.       return xunluo()
  24.    else
  25.       return checkJob()
  26.    end
  27. end
复制代码

  1. function checkJob()
  2. EnableTimer('',false)
  3.         --if hp.exp>800000 and hp.exp<2000000 and score.party=='明教'  then return xunluo() end ---xunluo
  4.    if job.zuhe["songxin2"] then
  5.       job.zuhe["songxin2"]=nil
  6.           job.zuhe["songxin"]=true
  7.           flag.sx2=true
  8.    end
  9.    if job.last and job.zuhe[job.last] then
  10.       if type(job.zuhe[job.last]) == "number" then
  11.               job.zuhe[job.last] = job.zuhe[job.last] + 1
  12.           else
  13.               job.zuhe[job.last] = 1
  14.           end
  15.    end
  16.    if countTab(job.zuhe) > 2 and not skills["xixing-dafa"] and job.zuhe["huashan"] and job.zuhe["wudang"] and jobtimes["华山岳不群惩恶扬善"] and jobtimes["武当宋远桥杀恶贼"] then
  17.           local t_hs = jobtimes["华山岳不群惩恶扬善"]
  18.           local t_wd = jobtimes["武当宋远桥杀恶贼"]
  19.           local t_times = math.fmod((t_hs+t_wd),50)
  20.           if t_times > 48 then
  21.              exe('pray pearl')
  22.              if job.last ~= "huashan" then
  23.                     return huashan()
  24.                  else
  25.                     for p in pairs(job.zuhe) do
  26.                             if p~= "huashan" and p~="wudang" and p~="hubiao" and p~="husong" and p~="songmoya" then
  27.                                    return _G[p]()
  28.                                 end
  29.                         end
  30.                  end
  31.           end
  32.    end
  33.    if score.party and score.party=="华山派" and countTab(job.zuhe) > 2 and not skills["dugu-jiujian"] and job.zuhe["huashan"] and job.zuhe["songxin"] then
  34.           local t_hs,t_sx,t_gb
  35.           
  36.           if jobtimes["华山岳不群惩恶扬善"] then
  37.              t_hs = jobtimes["华山岳不群惩恶扬善"]
  38.           else
  39.              t_hs = 0
  40.           end
  41.           if jobtimes["大理王府送信任务"] then
  42.              t_sx = jobtimes["大理王府送信任务"]
  43.           else
  44.              t_sx = 0
  45.           end
  46.           if jobtimes["丐帮吴长老杀人任务"] then
  47.              t_gb = jobtimes["丐帮吴长老杀人任务"]
  48.           else
  49.              t_gb = 0
  50.           end
  51.           local t_times = math.fmod((t_hs+t_sx+t_gb),50)
  52.           if t_times > 47 then
  53.              exe('pray pearl')
  54.              if job.last ~= "huashan" then
  55.                     return huashan()
  56.                  else
  57.                     for p in pairs(job.zuhe) do
  58.                             if p~= "huashan" and p~="songxin" and p~="hubiao" and p~="husong" and p~="songmoya" then
  59.                                    return _G[p]()
  60.                                 end
  61.                         end
  62.                  end
  63.           end
  64.    end

  65.    if job.third and job.zuhe[job.third] and job.last~=job.third then
  66.      if job.second and job.last==job.second then
  67.        if job.third=="wudang" and (not job.wdtime or job.wdtime<=os.time()) then
  68.           return _G[job.third]()
  69.        end
  70.        if job.third~="wudang" and job.third~="songmoya" then
  71.           return _G[job.third]()
  72.        end
  73.      end
  74.    end
  75.    if job.first and job.zuhe[job.first] and job.last~=job.first then
  76.       if job.first~="xueshan" and job.first~="wudang" and job.first~="songmoya" then
  77.              return _G[job.first]()
  78.           end
  79.           if job.first=="xueshan" and ((not condition.xueshan) or (condition.xueshan and condition.xueshan<=0)) then
  80.                  return _G[job.first]()
  81.           end
  82.           if job.first=="wudang" and (not job.wdtime or job.wdtime<=os.time()) then
  83.                  return _G[job.first]()
  84.           end
  85.       if job.first=="xueshan" and condition.xueshan and condition.busy and condition.busy>=condition.xueshan then
  86.          return _G[job.first]()
  87.           end
  88.    end
  89.    if job.second and job.zuhe[job.second] and job.last~=job.second then
  90.       if job.second~="xueshan" and job.second~="wudang" and job.second~="songmoya" then
  91.              return _G[job.second]()
  92.           end
  93.           if job.second=="xueshan" and ((not condition.xueshan) or (condition.xueshan and condition.xueshan<=0)) then
  94.                  return _G[job.second]()
  95.           end
  96.           if job.second=="wudang" and (not job.wdtime or job.wdtime<=os.time()) then
  97.                  return _G[job.second]()
  98.           end
  99.           if job.second=="xueshan" and condition.xueshan and condition.busy and condition.busy>=condition.xueshan then
  100.          return _G[job.second]()
  101.           end
  102.    end

  103.    for p in pairs(job.zuhe) do
  104.         if job.last ~= p and job.first ~= p and job.second ~= p and p ~= "songmoya" then
  105.                     return _G[p]()
  106.                     end
  107.          end

  108.    for p in pairs(job.zuhe) do
  109.         if job.last ~= p and p ~= "songmoya" then
  110.                     return _G[p]()
  111.                         end
  112.          end
  113.    if job.zuhe["xueshan"] and job.last~="xueshan" then
  114.       return xueshan()
  115.    end
  116.    if job.zuhe["huashan"] and job.last~="huashan" then
  117.       return huashan()
  118.    end
  119.    if job.zuhe["tmonk"] and job.last~="tmonk" then
  120.       return tmonk()
  121.    end
  122.    if job.zuhe["songxin"] and job.last~="songxin" then
  123.       return songxin()
  124.    end
  125.    if job.zuhe["wudang"] and job.last~="wudang" then
  126.       return wudang()
  127.    end
  128.    if job.zuhe["gaibang"] and job.last~="gaibang" then
  129.       return gaibang()
  130.    end
  131.    if job.zuhe["zhuoshe"] and job.last~="zhuoshe" then
  132.       return zhuoshe()
  133.    end
  134.    if job.zuhe["sldsm"] and job.last~="sldsm" then
  135.       return sldsm()
  136.    end
  137.    if job.zuhe["mjxunluo"] and job.last~="mjxunluo" then
  138.       return xunluo()
  139.    end
  140.    if job.zuhe["songshan"] and job.last~="songshan" then
  141.       return songshan()
  142.    end
  143.    if job.last~="songxin" then return songxin() end
  144.    if job.last~="mjxunluo" and score.party=="明教" then return xunluo() end
  145.    if job.last~="xueshan" and hp.shen<0 then return xueshan() end
  146.    if job.last~="wudang" and hp.shen>100000 then return wudang() end
  147.    if job.last~="gaibang" and hp.exp<2000000 and hp.shen>0 then return gaibang() end
  148.    if job.last~="songshan" and hp.shen<0 and hp.exp<2000000 then return songshan() end

  149. end
复制代码


  1. function idle_set()
  2.   if job.name=='ptbx' then return exe('praise ptbx') end
  3.         if job.name=='songmoya' then
  4.         print('正在颂摩崖任务中,当前死亡次数【'.. smydie ..'】次!设定杀死武士组数上限为【'.. smyteam ..'】组。进行组数为第【'.. yptteam ..'】组。')
  5.         exe('flatter')
  6.         return
  7.         end
  8.         if job.name=='husong' then
  9.         exe('aq')
  10.         print('正在护送任务中')
  11.         tmp.husong=tmp.husong+1
  12.         if tmp.husong>=40 then return husongQuit() end
  13.         return
  14.         end
  15.         if job.name=='mjxunluo' then
  16.         exe('aq')
  17.         print('正在巡逻中')
  18.         tmp.mjxunluo=tmp.mjxunluo+1
  19.         if tmp.mjxunluo>=40 then return xunluo() end
  20.         return
  21.         end
  22.         if job.name=='refine' then
  23.         exe('admire2')
  24.         print('正在提练矿石中')
  25.         return
  26.         end
  27.         if job.name=='hubiao' then
  28.         exe('admire2')
  29.         print('正在护镖中')
  30.         return
  31.         end
  32.         print(flag.idle)
  33.         exe('poem')
  34.    if not flag.idle or type(flag.idle)~="number" then
  35.       flag.idle = 0
  36.    end
  37.    flag.idle = flag.idle + 1
  38.    if flag.idle<10 then
  39.         DeleteTimer("walkWait10")
  40.         DeleteTimer("walkWait9")
  41.           if dest.area==nil then return end
  42.       if dest.area=='铁掌山' or dest.area=='苗疆' then
  43.              locate()
  44.                  if locl.room ~= job.room then
  45.                     return walk_wait()
  46.                  else
  47.                         if job.name=='wudang' then return wudangFindAct() end
  48.                         if job.name=='huashan' then return huashanFindAct() end
  49.                         if job.name=='xueshan' then return xueshan_find_act() end
  50.                         if job.name=='songxin' or job.name=='songxin2' then return songxin_find_go() end
  51.                  end
  52.       end
  53.       return
  54.    end
  55.    if flag.idle<8 then
  56.     if job.name=='xuncheng' then return xuncheng_huodu() end
  57.         end
  58.    if flag.idle<11 then
  59.          if job.name=='wudang' then return wudangFindFail() end
  60.          if job.name=='huashan' then return huashanFindFail() end
  61.          if job.name=='xueshan' then return xueshanFindFail() end
  62.          if job.name=='songxin' or job.name=='songxin2' then return songxinFindFail() end
  63.    end
  64.    if flag.idle<12 then
  65.       chats_log("ROBOT 可能已发呆".. flag.idle/2 .."分钟!","deepskyblue")
  66.           return
  67.    end
  68.    scrLog()
  69.    dis_all()
  70.    chats_locate('定位系统:发呆6分钟后,于【'.. locl.area .. locl.room ..'】重新启动系统!','red')
  71.    Disconnect()
  72.    Connect()
  73. end
复制代码

  1. function dnyTrigger()
  2.         DeleteTriggerGroup("qk_dny")
  3.         create_trigger_t('qk_dny1','^(> )*\\s*你把 "action" 设定为 "讨教大挪移中" 成功完成','','taoJiaozhang')
  4.         create_trigger_t('qk_dny2',"^(> )*你现在正忙着呢。",'','taoJiaozhang')
  5.         create_trigger_t('qk_dny3',"^(> )*(由于实战经验不足,阻碍了你的「乾坤大挪移」进步!|什么?|你的内力不够|你潜能不够,已经用完了。)",'','taojiao_over')
  6.         create_trigger_t('qk_dny4',"^(> )*你感觉全身气息翻腾,原来你真气不够,不能装备\\D*。",'','taojiao_over')
  7.         for i=1,4 do SetTriggerOption("qk_dny"..i,"group","qk_dny") end
  8.         EnableTriggerGroup("qk_dny",false)
  9. end
复制代码


这个函数太长了,替换前面就行,后面没动


  1. function jobSet()
  2.    local l_result,l_tmp,t
  3.    
  4.    t={
  5.                 ["wudang"] ="武当宋远桥",
  6.                 ["huashan"] ="华山岳不群",
  7.                 ["gaibang"] ="丐帮吴长老",
  8.                 ["songmoya"] ="颂摩崖抗敌任务",
  9.                 ["zhuoshe"] ="丐帮捉蛇",
  10.                 ["songxin"] ="大理送信",
  11.                 ["songxin2"]="大理送信2",
  12.                 ["xueshan"] ="雪山抢美女",
  13.                 ["sldsm"] ="神龙岛师门",
  14.                 ["songshan"]="嵩山左冷禅",
  15.   --    ["hubiao"] ="福州护镖",
  16.                 ["tmonk"] ="少林教和尚",
  17.                 ["clb"] ="长乐帮任务1",
  18.                 ["husong"] ="少林护送",
  19.                 ["hqgzc"] ="洪七公做菜",
  20.                 ["mjxunluo"] ="明教巡逻",
  21.    }
  22.    
  23.    t={}
  24.    
  25.    for p,q in pairs(job.list) do
  26.        t[p] = q
  27.    end
  28.    
  29.    if score.party~="丐帮" then t["zhuoshe"]=nil end
  30.         if score.party~="明教" then t["mjxunluo"]=nil end
  31.    if score.party~="神龙教" then t["sldsm"]=nil end
  32.    if score.party~="少林派" or hp.exp>2000000 or hp.exp<300000 then t["tmonk"]=nil end
  33.    if score.party~="少林派" or hp.exp<2000000 then t["husong"]=nil end
  34.    if hp.exp<5000000 then t["songmoya"]=nil end
  35.    if hp.shen<0 then t["gaibang"]=nil end
  36.    if hp.shen<0 and score.party=="华山派" then t["huashan"]=nil end
  37.    if hp.shen<0 then t["wudang"]=nil end
  38.    if hp.shen>0 then t["songshan"]=nil end
复制代码


check_pot函数里面增加,放到学习literate后面

  1.    if score.party=='明教' and skills["qiankun-danuoyi"] and skills["qiankun-danuoyi"].lvl>200 and (skills["qiankun-danuoyi"].lvl<210 or skills["qiankun-danuoyi"].lvl>450) and skills["qiankun-danuoyi"].lvl<hp.pot_max-100 then
  2.       return check_dny()
  3.    end
复制代码



二、 lujing.lua 中替换

  1. function find(l_area,l_room)
  2.         if job.room~=nil and (job.room=='紫杉林' or string.find(job.room,"字门")) and job.name~="mjxunluo" then create_timer_st('zsl_timer',30,'.') end
  3.     do return search() end
  4. end
复制代码

  1. function walk_goon()
  2.     EnableTriggerGroup("walk",false)
  3.     EnableTimer('walkwait',false)
  4.         EnableTrigger("hp12",false)
  5.         if tmp.find then
  6.        return check_halt(searchFunc)        --xunluo
  7.         end
  8.         EnableTrigger("hp12",true)
  9.     create_timer_s('roadWait',road.wait,'path_start')
  10. end
复制代码


下面的也太长了,替换一半就行

  1. function searchFunc(path)
  2.         --Note("run searchFunc")
  3.     if flag.find==1 then return end
  4.     if flag.wait==1 then return end
  5.     road.pathset = road.pathset or {}
  6.     if path then
  7.        road.pathset=utils.split(path,";")
  8.            for i=1,table.getn(road.pathset) do
  9.                for p=1, table.getn(road.pathset) do
  10.                        if isNil(road.pathset[p]) or road.pathset[p]=="halt" then
  11.                               table.remove(road.pathset,p)
  12.                                   break
  13.                            end
  14.                    end
  15.            end
  16.         end
  17.         if job.name=="mjxunluo" and table.getn(road.pathset)==0 and job.xunluonpc then        ----xunluo
  18.                          return check_halt(xunluoHuayin)
  19.          end
  20.         if table.getn(road.pathset)==0 then
  21.            return searchStart()
  22.         end
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×

评分

1

查看全部评分

门派:天龙寺
发表于 2024-6-7 15:42:53 | 显示全部楼层
大波妹万岁啊。公版又升级了!!
门派:华山派
发表于 2024-6-7 16:34:14 | 显示全部楼层
我刚巡罗完呀,明教要崛起
门派:桃花岛
发表于 2024-6-7 20:52:46 | 显示全部楼层
我巡逻 完事了 都解开九阳了 不过是后来人的福利了!
门派:嵩山派
发表于 2024-6-8 11:34:46 | 显示全部楼层
看来一个个都去明教开号了啊
门派:嵩山派
发表于 2024-6-8 11:35:22 | 显示全部楼层
大波妹出品,必属精品,顶!
门派:华山派
发表于 2024-6-9 16:53:07 | 显示全部楼层
是啊,后续的人就有福了
门派:少林派
发表于 2024-6-19 14:45:38 | 显示全部楼层
准备去练个明教,太好了
门派:古墓派
发表于 2024-6-25 15:16:32 | 显示全部楼层
我是来学习的
门派:明教
发表于 2024-10-4 22:31:00 | 显示全部楼层
用的MUSH 版的,具体该怎么操作。请教iao
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-17 05:24 , Processed in 0.047977 second(s), 29 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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