赤脚大仙 发表于 2024-5-14 21:38:16

求助3.35双持邪三刀流循环有个小问题传染达到要求时不施放

本帖最后由 赤脚大仙 于 2024-5-14 09:43 PM 编辑

local dszj="888338"
local hmf="50191"
local kb="888339"
local tiaoshi=false
local MT=false

-------------------------------------------------------------
--"函数部分"
-------------------------------------------------------------
function daying(text)
    if not tiaoshi then return end
    local lasttext=BeeGetVariable("lasttext")
    if lasttext==nil then lasttext="" end
    if text~=lasttext then print(text) BeeSetVariable("lasttext",text) end
end

function youxiao()
    if not UnitIsDeadOrGhost("target") and BeeUnitCanAttack("target") and InLosTo() then return true else return false end
end

function zuoqi()
    if IsMounted("player")==1 then return true else return false end
end

function zhandou()
    if BeeUnitAffectingCombat("player") then return true else return false end
end

function apr()
    if GetNumRaidMembers()>0 then
      return "r"
    elseif GetNumPartyMembers()>0 then
      return "p"      
    else
      return "a"               
    end
end

function juli(unit) --距离
    if not unit then unit="target" end
    local guid = UnitGUID(unit)
    return LDistance( UnitGUID("player"),guid)         
end

function table_maxn(t)
    local mn=nil;
    local n
    for k, v in pairs(t) do
      if(mn==nil) then
            mn=v
            n=k
      end
      if v>mn then
            mn = v
            n=k
      end
    end
    return n
end
function zuiduanCD(type) --Bee的获取最短CD函数有bug,只能重新写一个
    local CD={}
    for i=1,6 do
      local cd=RuneCD(i)
      if GetRuneType(i)==type and cd~=0 then
            table.insert(CD, cd)
      end
    end
    if table.getn(CD)==0 then
      return 0
    end
    local min=0
    for k,v in pairs(CD) do
      if min==0 or v<min then min=v end
    end
    return min
end
function RuneCD(id)
    if id==3 thenid=5elseif id==4then id=6elseif id==5 thenid=3 elseif id==6 then    id=4end
    local a,b,c=GetRuneCooldown(id)
    local cd=b-(GetTime()-a)
    if cd<0 then
      return 0
    else
      return cd
    end
end

function chuanran()
    local guid = LMonsterGUID(15)
    for k, v in pairs(guid) do
      if IsInCombat(v) == 1 then
            local list=GetBuffList(v)
            if Li.FindBuff(list,"血之疫病",mid)<=0 and Li.FindBuff(list,"冰霜疫病",mid)<=0 then
                if BeeStringFind("血之疫病",tarbuff) and BeeStringFind("冰霜疫病",tarbuff) then
                  if BeeIsRun("传染") and allow then
                        BeeRun("传染")
                        return true
                  elseif BeeSpellCD("活力分流")==0 and RuneCD(1)>1 and RuneCD(2)>1 then
                        daying("活力分流强传染")
                        BeeRun("活力分流")
                        return true
                  end
                end
            end
      end
    end
    return false
end

--"函数部分结束"
-------------------------------------------------------------
--"变量部分"
-------------------------------------------------------------
local mybuff=BeeUnitBuffList("player")
local mid=UnitGUID("player")
local tarbuff=BeeUnitBuffList("target")
local mymp=BeeUnitMana("player")
local tarhp=BeeUnitHealth("target")
local myhp=BeeUnitHealth("player","%")
local apr=apr()

-------------------------------------------------------------
--"快捷键"
-------------------------------------------------------------
if modtimer == nil then modtimer = 0 end
if IsBoss == nil then IsBoss = false end
if IsLeftControlKeyDown() and not GetCurrentKeyBoardFocus() and GetTime() - modtimer > 1 then
    modtimer = GetTime()
    if IsBoss==false then
      IsBoss=true
      print("\124cFFC2C050>>>>>>>>\124cFFE61515模式:进入爆发\124cFFC2C050<<<<<<<<")
    else
      IsBoss=false
      print("\124cFFC2C050>>>>>>>>\124cFF15E615模式:退出爆发\124cFFC2C050<<<<<<<<")
    end
end
-------------------------------------------------------------
--"插队函数"
-------------------------------------------------------------
if BeeCastSpellFast() then   
    return true;
end

-------------------------------------------------------------
--"非战斗部分"
-------------------------------------------------------------
--全局buff
if zuoqi() or BeeUnitCastSpellName("player") or BeeStringFind("格拉库的肉松蛋糕",mybuff) or BeeStringFind("进食",mybuff) then
    return
end

if apr=="a" then AutoLoot() end

if not BeeStringFind("白骨之盾",mybuff) and BeeSpellCD("白骨之盾")==0 and not zhandou() then
    daying("白骨之盾")
    BeeRun("白骨之盾")
    return
end
if not BeeStringFind("寒冬号角",mybuff) then BeeRun("寒冬号角") end
if BeeSpellCD("亡者复生")==0 and not HasPetUI() then daying("亡者复生") BeeRun("亡者复生") end

local bfqs=BeeGetVariable("bfqs")
if bfqs == nil then bfqs = false end

if MT and not BeeStringFind("冰霜灵气",mybuff) then
    BeeRun("冰霜灵气")
    return
elseif IsBoss and BeeSpellCD("召唤石像鬼")<8 and BeeSpellCD("符文武器增效")<8 and zuiduanCD(1)==0 and zuiduanCD(2)==0 and zuiduanCD(3)==0 and not zhandou() then
    if not BeeStringFind("邪恶灵气",mybuff) then
      daying("邪恶灵气")
      BeeRun("邪恶灵气")
      return
    else
      if not bfqs then
            daying("符文恢复结束后可以爆发起手")
            BeeSetVariable("bfqs", true)
            return
      end
    end
elseif not IsBoss and not BeeStringFind("鲜血灵气",mybuff) and not bfqs and myhp>=60 and not MT then
    BeeRun("鲜血灵气")
    return
end


if not IsCombat then IsCombat = false end
if not zhandou() then
    if IsBoss and IsCombat then IsBoss=false IsCombat=false print("\124cFFC2C050>>>>>>>>\124cFF15E615模式:退出爆发\124cFFC2C050<<<<<<<<") end
    return
end
IsCombat = true
-------------------------------------------------------------
--"战斗部分"
-------------------------------------------------------------

--"爆发起手"
--绿脸,黑魔法副手。血打-》天打-》枯萎凋零-》强力武器重置所有符文-》冰打-》暗打-》召天鬼(到这里为止的操作需要在5秒内完成,不然天鬼吃不到雷鸣多彩480急速加成)-》切换红脸
if bfqs then
    if BeeSpellCD("召唤石像鬼")>1.5 then daying("退出爆发起手") BeeSetVariable("bfqs",false) return end
   
    if BeeRune(1)+BeeRune(2)+BeeRune(3)+BeeRune(4)==0 and BeeSpellCD("符文武器增效")==0 then daying("爆发起手-符文武器增效") BeeRun("符文武器增效") return end
    if BeeSpellCD("符文武器增效")>0 then
      if BeeUnitBuff("冰霜疫病","target")>1.5 and BeeUnitBuff("血之疫病","target")>1.5 then
            daying("爆发起手-召唤石像鬼")
            --"饰品"
            if GetItemSpell(GetItemInfo(GetInventoryItemLink('player',13))) and GetInventoryItemCooldown("Player",13)==0 then
                BeeRun("/use 13")
            end
            if GetItemSpell(GetItemInfo(GetInventoryItemLink('player',14))) and GetInventoryItemCooldown("Player",14)==0 then
                BeeRun("/use 14")
            end   
            BeeRun("血性狂怒")
            BeeRun("召唤石像鬼")
            return
      else
            if BeeUnitBuff("冰霜疫病","target")<=1.5 then daying("爆发起手-冰冷触摸") BeeRun("冰冷触摸") return end
            if BeeUnitBuff("血之疫病","target")<=1.5 then daying("爆发起手-暗影打击") BeeRun("暗影打击") return end
      end
    else
      if zuiduanCD(1)==0 then daying("爆发起手-鲜血打击") BeeRun("鲜血打击") return end
      if zuiduanCD(2)==0 and zuiduanCD(3)==0then daying("爆发起手-天灾打击") BeeRun("天灾打击") return end
      if BeeSpellCD("枯萎凋零")==0 and zuiduanCD(1)~=0 and zuiduanCD(2)~=0 and zuiduanCD(3)~=0 then         
            daying("爆发起手-枯萎凋零")
            CastTarGet()
            BeeRun("/cast !枯萎凋零")
            return
      end
    end
end

-------------------------------------------------------------
--"三刀流部分"
local hmfTime = BeeGetVariable("hmfTime")
if hmfTime == nil then hmfTime = 0 end
local hmfjx = time() - hmfTime >= 45
if not IsEquippedItem("item:"..dszj) then BeeRun("/equipslot 16 item:"..dszj) end
if hmfjx then
    --daying("可以装备黑魔法")
    if BeeStringFind("黑魔法",mybuff) then BeeSetVariable("hmfTime",time()) return end
    if not IsEquippedItem("item:"..hmf) then BeeRun("/equipslot 17 item:"..hmf) end   
else
    --daying("可以装备狂暴")
    if not IsEquippedItem("item:"..kb) then BeeRun("/equipslot 17 item:"..kb) end
end

-------------------------------------------------------------

--"打断部分"
if BeeUnitCastSpellName("target")~=false then   
    if BeeIsRun("心灵冰冻") then
      daying("心灵冰冻")
      BeeRun("心灵冰冻")
      return
    elseif GetPetActionCooldown(5)==0 and GetPetActionCooldown(7)==0 and BeeSpellCD("亡者复生")==-1 then      
      BeeRun("/petpassive")
      BeeRun("/cast 撕扯")
      BeeRun("/cast 跳跃")
    elseif BeeIsRun("绞袭") then
      daying("绞袭")
      BeeRun("绞袭")
      return
    elseif BeeIsRun("反魔法护罩") then
      daying("反魔法护罩")
      BeeRun("反魔法护罩")
      return   
    end
end
-------------------------------------------------------------

--"保命"
if myhp<=30 and BeeSpellCD("天灾契约")==0 then
    daying("保命-天灾契约")
    BeeRun("天灾契约")
end
if myhp<=50 and BeeSpellCD("冰封之韧")==0 then
    daying("保命-冰封之韧")
    BeeRun("冰封之韧")
end
if myhp<=60 and not BeeStringFind("冰霜灵气",mybuff) and apr~="r"then
    daying("保命-冰霜灵气")
    BeeRun("冰霜灵气")
    return
end

-------------------------------------------------------------

--"宠物控制"
if HasPetUI() or BeeSpellCD("亡者复生")==-1 then
    if juli("pet")>=50 then PetDismiss() return end
    if not youxiao() or juli()>10 and IsPetAttackActive() then alan("PetStopAttack()") end
    if youxiao() and juli()<=10 and not IsPetAttackActive() then alan("PetAttack()") end
    if BeeUnitHealth("pet")<=80 and UnitIsUnit("pet","pettargettarget") and BeeSpellCD("蜷缩")==0 then BeeRun("蜷缩") return end
    --if not BeeStringFind("食尸鬼狂乱") and BeeIsRun("食尸鬼狂乱") and bing==0 and xie==0 and panding() then BeeRun("食尸鬼狂乱") return end
end
-------------------------------------------------------------

if not youxiao() then
    BeeRun("/cleartarget")
    return
else
    BeeAttack()
end
-------------------------------------------------------------

--"爆发部分"
if IsBoss then
    if BeeSpellCD("亡者大军")==0 then daying("常规爆发-亡者大军") BeeRun("亡者大军") return end
    if BeeSpellCD("召唤石像鬼")==0 and mymp>=60 and BeeStringFind("黑魔法",mybuff) then
      daying("常规爆发-召唤石像鬼")
      --"饰品"
      if GetItemSpell(GetItemInfo(GetInventoryItemLink('player',13))) and GetInventoryItemCooldown("Player",13)==0 then
            BeeRun("/use 13")
      end
      ifGetItemSpell(GetItemInfo(GetInventoryItemLink('player',14))) and GetInventoryItemCooldown("Player",14)==0 then
            BeeRun("/use 14")
      end   
      BeeRun("血性狂怒")
      BeeRun("召唤石像鬼")
      return
    end
    if BeeRune(1)+BeeRune(2)+BeeRune(3)+BeeRune(4)==0 and BeeSpellCD("符文武器增效")==0 then daying("常规爆发-符文武器增效") BeeRun("符文武器增效") return end
end
-------------------------------------------------------------

--"枯萎第一优先级"
local kwTime = BeeGetVariable("kwTime")
if kwTime == nil then kwTime = 0 end
local kwcd=15+kwTime-time()
local IsSucceed = time() - kwTime >= 13
if IsSucceed then
    if Li.FindBuff(GetBuffList(UnitGUID("target")), "枯萎凋零", mid)>0 then BeeSetVariable("kwTime", time()) end
    if not BeeStringFind("孤寂",mybuff) and zuiduanCD(1)==0 then
      daying("常规输出-补孤寂")
      BeeRun("鲜血打击")
      return
    end
    if juli()<=15 and InLosTo()==0 and IsMoving()==0then
      daying("常规输出-枯萎")
      CastTarGet()
      BeeRun("/cast !枯萎凋零")
      BeeSetVariable("kw", 0)
      return
    end
end

-- or math.abs(zuiduanCD(i)-kwcd)<1
local allow={false,false,false,false}
for i=1,4 do
    if zuiduanCD(i)==0 or zuiduanCD(i)<=kwcd then allow=true end
end

if MT and not BeeStringFind("冰霜灵气",mybuff) and allow then
    BeeRun("冰霜灵气")
    return
elseif not bfqs and not BeeStringFind("鲜血灵气",mybuff) and allow and not MT and myhp>60 then
    BeeRun("鲜血灵气")
    return
end
-------------------------------------------------------------
--"双病与传染"
if BeeUnitBuff("血之疫病","target")==-1 and BeeUnitBuff("冰霜疫病","target")==-1 then
    if LMonsterCount(15)>1 then
      local guid = LMonsterGUID(15)
      local arrhp={}
      local arrnam={}
      local arrbhp={}
      local arrbnam={}
      if guid then
            for k, v in ipairs(guid) do
                if IsInCombat(v) == 1 then
                  arrhp[#arrhp+1]=GetHealth(v)
                  arrnam[#arrnam+1]=v
                  if Li.FindBuff(GetBuffList(v), "血之疫病", mid)>1.5 then
                        arrbnam[#arrbnam+1]=v
                        arrbhp[#arrbhp+1]=GetHealth(v)
                  end
                end
            end
            if #arrbnam>1 then
                SelectM(arrbnam)
                if BeeIsRun("传染") and allow then
                  BeeRun("传染")
                end
                return
            else
                SelectM(arrnam)
                if BeeUnitBuff("血之疫病","target")==-1 and BeeIsRun("暗影打击") and allow then
                  daying("常规补-暗打")
                  BeeRun("暗影打击")
                  return
                end
                if BeeUnitBuff("冰霜疫病","target")==-1 and BeeIsRun("冰冷触摸") and allow then
                  daying("常规补-冰触")
                  BeeRun("冰冷触摸")
                  return
                end   
            end
      end
    else
      if BeeUnitBuff("血之疫病","target")==-1 and BeeIsRun("暗影打击") and allow then
            daying("常规补-暗打")
            BeeRun("暗影打击")
            return
      end
      if BeeUnitBuff("冰霜疫病","target")==-1 and BeeIsRun("冰冷触摸") and allow then
            daying("常规补-冰触")
            BeeRun("冰冷触摸")
            return
      end   
    end
else
    if BeeUnitBuff("血之疫病","target")==-1 and BeeIsRun("暗影打击") and allow then
      daying("常规补-暗打")
      BeeRun("暗影打击")
      return
    end
    if BeeUnitBuff("冰霜疫病","target")==-1 and BeeIsRun("冰冷触摸") and allow then
      daying("常规补-冰触")
      BeeRun("冰冷触摸")
      return
    end   
end
-------------------------------------------------------------
--"传染"
if chuanran() then return end
-------------------------------------------------------------
--"次优先大便"
if BeeIsRun("凋零缠绕") then
    if (myhp<=50 and mymp<=20) or (myhp<=30 and mymp<=40) or (IsBoss and BeeSpellCD("召唤石像鬼")==0) then
    else
      daying("常规-大便")
      BeeRun("凋零缠绕")
      return
    end
end
-------------------------------------------------------------

--"无需补传染时血打消耗鲜血符文"
if BeeIsRun("鲜血打击") and allow then
    daying("耗符文-血打")
    BeeRun("鲜血打击")
    return
end
-------------------------------------------------------------

--"根据血量判断天打或灵打"
if BeeIsRun("天灾打击") and allow and allow then
    if myhp>=70 then
      daying("耗符文-天打")
      BeeRun("天灾打击")
    else
      daying("耗符文-灵打")
      BeeRun("灵界打击")
    end
    return
end
-------------------------------------------------------------

--"最低优先级,吹号"
if not BeeStringFind("寒冬号角",mybuff) then daying("常规-号角") BeeRun("寒冬号角") return end

赤脚大仙 发表于 2024-5-14 22:07:57

自己顶一个 在线等{:5_238:}

lorky 发表于 2024-5-14 22:11:31

这尼玛,看着都累,我虚了!

wo5322651 发表于 2024-5-14 22:12:10

同求助,感觉挺屌的样子

maddd 发表于 2024-5-15 00:08:05

会不会是因为传染条件没设置好,或者是没符文打传染了

8503786 发表于 2024-5-15 10:21:25

一般是有设置了传染条件吧

赤脚大仙 发表于 2024-5-15 13:14:28

有没有大佬优化啊?{:5_247:}

8503786 发表于 2024-5-16 10:32:04

这个要高级解锁器才能用
页: [1]
查看完整版本: 求助3.35双持邪三刀流循环有个小问题传染达到要求时不施放