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

三种内力药完美服用解决方案!

[复制链接]
门派:桃花岛
 楼主| 发表于 2019-2-27 14:01:42 | 显示全部楼层
第九步:

function checkNxw()--检查内息丸、川贝丸和黄芪丹的存量,如果小于上限20,则随即选择一个药铺去购买!
   tmp.cnt=0
   if score.gold and score.gold>100 and (nxw_cur<count.nxw_max or cbw_cur<count.cbw_max or hqd_cur<count.hqd_max) then
      return go(checkNxwBuy,randomElement(drugBuy["内息丸"]))
   else
      return checkNxwOver()
   end
end
function checkNxwBuy()--设置计数器tmp.cnt,每购买一次+1,就算药铺老板busy,也是最多买30次停止,避免无限制购买下去!
   tmp.cnt = tmp.cnt + 1
   if tmp.cnt > 30 then
      return checkNxwOver()
   else
          if hqd_cur<count.hqd_max then--这里是买3种内力药了,购买的次序分别是黄芪丹,川贝丸和内息丸,注意:黄芪丹+70%,川贝丸+50%,内息丸是固定+3000内力。
         exe('buy '..drug.neili3)
          end
          if cbw_cur<count.cbw_max then
         exe('buy '..drug.neili2)
          end
          if nxw_cur<count.nxw_max then
         exe('buy '..drug.neili1)
          end

      checkYaoBags()
      return check_bei(checkNxwi)
   end
end
function checkNxwi()--这个函数是判断药品是否买够,没买够则继续购买!
   if (nxw_cur<count.nxw_max or cbw_cur<count.cbw_max or hqd_cur<count.hqd_max) and Bag["黄金"] and Bag["黄金"].cnt>4 then
      return checkWait(checkNxwBuy,1)
   else
      return checkNxwOver()
   end
end
function checkNxwOver()
   return check_bei(checkPrepare,1)
end
门派:铁掌帮
发表于 2019-2-27 14:07:41 | 显示全部楼层
内息丸可以忽略
只要买2种就够了            
门派:桃花岛
 楼主| 发表于 2019-2-27 14:10:45 | 显示全部楼层
第十步:设置药品的服用

function xuexiContinue()
    flag.idle=nil
    xuefull=0
        if hp.neili<1000 and hqd_cur>0 then--这是学习中内力不足,我反正直接黄芪丹,大家也可以调整为别的药品
           exe('eat huangqi dan')
        end
        if hp.neili<600 and hqd_cur>0 then
           exe('eat huangqi dan')
        end

    EnableTriggerGroup("xuexi",true)
      wait.make(function()
       wait.time(1)
       exe('yun jing;xue '..master.id..' '.. master.skills[tmp.xuexi] ..' '.. master.times)
       end)
        print('学习点数:'..master.times)
    exe('hp')
end

-------

function literateXue()
    if not locl.id["顾炎武"] then
           return literateBack()
        end
    if hp.neili<100 then --内力小于100,嗑黄芪丹
           if hqd_cur>0 then
              exe('eat huangqi dan')

           elseif hp.exp<800000 then
              return xuexi()
           else
          return literateBack()
           end
    end
        if hp.neili<1000 then--内力小于1000,嗑川贝丸。
           exe('eat '.. drug.neili2)
        end

    if hp.pot>master.times-1 then
       --yunAddInt()
       exe('yun jing;xue gu literate '..master.times)
       return check_busy(literateCheck)
    elseif hp.pot<master.times then
       return literateBack()
        else
           return literateBack()
    end
end

--------

function duanzaoXue()--锻造时内力不足
    if not locl.id["铸剑师"] then
           return duanzaoBack()
        end
    if hp.neili<100 then
           if hqd_cur>0 then
              exe('eat huangqi dan')

           else
          return duanzaoBack()
           end
    end
        if hp.neili<1000 then
           exe('eat '.. drug.neili2)
        end

    if skills["duanzao"] and skills["duanzao"].lvl>=221 then
       return duanzaoBack()
    end
    if Bag and Bag["黄金"] and Bag["黄金"].cnt and Bag["黄金"].cnt>30 and hp.pot>master.times-1 then
       --yunAddInt()
       exe('yun jing;xue shi duanzao '..master.times)
       return duanzaoCheck()
    elseif hp.pot<master.times then
       return duanzaoBack()
    elseif score.gold>300 then
       return check_bei(duanzaoQu,1)
        else
           return duanzaoBack()
    end
end

------

function zhizaoXue()--织造时内力不足!
    if not locl.id["老裁缝"] then
           return zhizaoBack()
        end
    if hp.neili<100 then
           if hqd_cur>0 then
              exe('eat huangqi dan')

           else
          return zhizaoBack()
           end
    end
        if hp.neili<1000 then
           exe('eat '.. drug.neili2)
        end

    if skills["zhizao"] and skills["zhizao"].lvl>=221 then
       return zhizaoBack()
    end
    if Bag["黄金"] and Bag["黄金"].cnt and Bag["黄金"].cnt>30 and hp.pot>master.times-1 then
       --yunAddInt()
       exe('yun jing;xue caifeng zhizao '..master.times)
       return zhizaoCheck()
    elseif hp.pot<master.times then
       return zhizaoBack()
    elseif score.gold>300 then
       return check_bei(zhizaoQu,1)
        else
           return zhizaoBack()
    end
end
门派:桃花岛
 楼主| 发表于 2019-2-27 14:11:19 | 显示全部楼层
ternis@tj 发表于 2019-2-27 14:07
内息丸可以忽略
只要买2种就够了

pk时还是很有用吧?一次加3000呢!
门派:桃花岛
 楼主| 发表于 2019-2-27 14:17:00 | 显示全部楼层
本帖最后由 kkfromch@tj 于 2019-2-27 15:44 编辑

第十一步:战斗时嗑药设置

这个是job.lua里——

function hp_heqi_check(n,l,w)
    heqi = tonumber(w[1])
    print("heqi="..heqi)
if hp.qixue_per<35 and dhd_cur>0 then
    exe('fu dahuan dan')
end
if hp.qixue_per<70 and cty_cur>0 then
       exe('eat chantui yao')
    end
        if (hp.qixue / (hp.qixue_max / hp.qixue_per ) < 35) and cty_cur>0 then
       exe('eat chantui yao')
    end
    if hp.qixue<hp.qixue_max*0.7 then
       exe('yun qi')
    end
    if hp.jingxue<hp.jingxue_max*0.5 then
       exe('yun jing')
    end
        if hp.neili<hp.neili_max*0.4 and cbw_cur>0 then--内力小于40%,优先嗑川贝丸!
       exe('eat '.. drug.neili2)
    end
        if hp.neili<hp.neili_max*0.3 and hqd_cur>0 then--内力小于30%,再嗑黄芪丹!
       exe('eat '.. drug.neili3)
    end

    if hp.jingli<hp.jingli_max*0.5 or hp.jingli<500 then
       exe('yun jingli')
    end
   if hp.neili<hp.neili_max*0.1 and nxw_cur>0 then--内力小于10%,嗑内息丸!
       exe('eat '.. drug.neili1)
    end


-------

至此,所有设定完毕!三种内力药可以轮番使用了!

大家使用过程中,如果有任何问题,请随时回帖!

------

差点忘记了,最后还要设置iset药品购买列表,还是回到shujian.lua

function drugSet()
   drugPrepare={}
   local t={
   ["内息丸"] = "内息丸",
   ["川贝内息丸"] = "川贝内息丸",
   ["黄芪内息丹"] = "黄芪内息丹",
--添加三种药品名称,然后在iset里选定即可!
   ["蝉蜕金疮药"] = "蝉蜕金疮药",
   ["活血疗精丹"] = "活血疗精丹",
   ["大还丹"] = "大还丹",
   ["火折"] = "火折",
   ["牛皮酒袋"] = "牛皮酒袋",
   }
门派:丐帮
发表于 2019-2-27 14:17:38 来自手机 | 显示全部楼层
liumaisj@tj 发表于 2019-2-27 14:11
pk时还是很有用吧?一次加3000呢!

有用的,特别做官府,护镖这样的任务。
门派:铁掌帮
发表于 2019-2-27 16:20:38 | 显示全部楼层
这个帖子太细致了,按着改不会出错
门派:姑苏慕容
发表于 2019-2-27 21:40:40 | 显示全部楼层
第六步是不是有点问题,有个符号帖子里显示不出来
门派:明教
发表于 2019-2-27 22:37:35 | 显示全部楼层
ooxx@tj 发表于 2019-2-27 21:40
第六步是不是有点问题,有个符号帖子里显示不出来

复制蓝色部分就行啊!那几行没问题
门派:桃花岛
 楼主| 发表于 2019-2-27 23:00:55 | 显示全部楼层
kuer@tj 发表于 2019-2-27 13:56
if hp.neili0 then
       exe('eat '.. drug.neili)
    end

我没这么写啊!这是你的code吗?

我那里是drug.neili1,drug.neili2,drug.neili3,反正到了限度就开始吃,先黄芪丹,然后川贝,然后内息丸。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-9 13:46 , Processed in 0.026436 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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