逆天修罗 发表于 2016-5-8 15:02:06

再次求教。。。。

local mg = msFGC(10)
local TANKS = msFindUnit('UnitGroupRolesAssigned(unit) == "TANK" and not UnitIsDeadOrGhost(unit) and UnitCanAssist("player",unit) and msGFD(unit)<=40 and msII(unit)',nil,true)
local tank,tank_hp = msGetMin('msGFD(unit)<=40',nil,TANKS)
--没有生命绽放的TANKS
local not_smzf_T,not_smzf_T_hp = msGetMin('not msGUB("生命绽放",unit,"player") and msGHP(unit)<99',nil,TANKS)
--没有生命绽放的队友
local not_smzf_p = msFindUnit('UnitCanAssist("player",unit) and not msGUB("生命绽放",unit,"player") and msII(unit) and msGHP(unit)<95 and msGFD(unit)<=40',nil,true)
--没有生命绽放血量最低的队友
local minnot_smzf_p,minnot_smzf_p_hp = msGetMin('msGFD(unit)<=40',nil,not_smzf_p)
--有生命绽放的队友
local yes_smzf = msFindUnit('UnitCanAssist("player",unit) and msGUB("生命绽放",unit,"player") and msII(unit) and msGHP(unit)<95 and msGFD(unit)<=40',nil,true)
local first
if UnitExists("targettarget") and UnitCanAssist("player","targettarget") then
   first = "targettarget"
elseif UnitExists("focus") and UnitCanAssist("player","focus") then
   first = "focus"   
else
   first = "player"
end

--tg_smzf 生命绽放的目标
local tg_smzf = {};
if grouptype == "party" then
   if TANKS then
      tg_smzf = TANKS
   end
elseif grouptype == "raid" then
   if UnitExists("targettarget") and not UnitIsDeadOrGhost("targettarget") and UnitCanAssist("player","targettarget") and msII("targettarget")
   and UnitGroupRolesAssigned("targettarget") == "TANK" and msGFD("targettarget")<=40 then
      table.insert(tg_smzf,"targettarget");
   end
   if UnitExists("focus") and not UnitIsDeadOrGhost("focus") and UnitCanAssist("player","focus") and msII("focus") and select(2,msGFD("focus"))<=40 then
      table.insert(tg_smzf,"focus");
   end   
end   
if tg_smzf and #tg_smzf>=2 then
   if UnitGUID(tg_smzf) == UnitGUID(tg_smzf) then
      table.remove(tg_smzf,2);
   end
end
if tg_smzf and #tg_smzf<2 then
   if not_smzf_T then
      if not_smzf_T_hp<80 and not tContains(tg_smzf,not_smzf_T) then
         table.insert(tg_smzf,not_smzf_T);
      elseif not_smzf_T_hp>=80 and minnot_smzf_p and minnot_smzf_p*2<=not_smzf_T_hp and not tContains(tg_smzf,minnot_smzf_p) then
         table.insert(tg_smzf,minnot_smzf_p);
      end
   elseif minnot_smzf_p and not tContains(tg_smzf,minnot_smzf_p) then
      table.insert(tg_smzf,minnot_smzf_p);
   end            
end
if msGHP() < 40 and msISC("树皮术") then
   msR("树皮术")
end
if msGHP() < 40 and msISC("铁木树皮") then
   msR("铁木树皮")
end
if msGHP() < 30 and msISC("治疗石") then
   msR("治疗石")
end
if msICM("源生") or msICM("宁静") then
   return;
end

if msICS("player","宁静") then
   return;
end

if tg_smzf and #tg_smzf>=1 then
   if not yes_smzf then
      if tg_smzf and tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") then
         msR("生命绽放",tg_smzf)
         return;
      end
      if tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") then
         msR("生命绽放",tg_smzf)
         return;
      end
   end
   if yes_smzf and #yes_smzf==1 then
      if tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") and msGUB("生命绽放",tg_smzf,"player") then
         msR("生命绽放",tg_smzf)
         return;
      end
      if tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") and msGUB("生命绽放",tg_smzf,"player")then
         msR("生命绽放",tg_smzf)
         return;
      end
   end
   if yes_smzf and #yes_smzf==2 then
      if tg_smzf and msISC("生命绽放",tg_smzf) and msGBT("生命绽放",tg_smzf,"player")<=2 and (msGBT("生命绽放",yes_smzf,"player")<=2 or msGBT("生命绽放",yes_smzf,"player")<=2) then
         msR("生命绽放",tg_smzf)
         return;
      end
      if tg_smzf and msISC("生命绽放",tg_smzf) and msGBT("生命绽放",tg_smzf,"player")<=2and (msGBT("生命绽放",yes_smzf,"player")<=2 or msGBT("生命绽放",yes_smzf,"player")<=2) then
         msR("生命绽放",tg_smzf)
         return;
      end
   end
end


生命绽放怎么不释放


逆天修罗 发表于 2016-5-8 21:20:03

追悼者 发表于 2016-5-8 21:02
你这段脚本不完整吧,还有上下文结合才行.缺少上文对grouptype的定义

local grouptype=""
if GetNumGroupMembers()>5 then
   grouptype="raid"
else
   grouptype="party"
end
if msICM("野性蘑菇") then
end
if not msGUB("疯狂耳语,德拉诺强效智力合剂,德拉诺智力合剂") and msGCD("奥拉留斯的低语水晶")<=0 and not IsMounted() then
   msRun("/cast 奥拉留斯的低语水晶")
end
if not msGUB("专注强化") and msGCD("高能强化符文")<=0 and not IsMounted() then
   msRun("/cast 高能强化符文")
end
if msGBT("野性印记")<10 and not IsMounted() then
   msRun("/cast 野性印记")      
end
ifUnitIsDeadOrGhost("player") or (UnitInVehicle("Player") and not msGUB("157060,157059")) or (IsMounted("player") and not msGUB("霜狼战狼,塔拉塔布羊,157060,157059")) then
   return;
end

local X;
if msGPP()>50 then
   X = 1
else
   X = 1.5
end
if msruninspell() then
end

local S={};
S["回春"] = msGSN("回春术")
S["愈合"] = msGSN("愈合")
S["治疗之触"] = msGSN("治疗之触")

local tuans = msFindUnit('msII(unit) and select(2,msGFD(unit))<=40',nil,true)
local tuan,tuan_hp = msGetMin('msGHP(unit)<=95',nil,tuans)
local huichun , huichunvalue = msGetMin('msII(unit) and not msGUB("回春术",unit,"player") and select(2,msGFD(unit))<=40',nil,tuans)
local YX = msFindUnit('msGHP(unit)<90 and msII(unit) and select(2,msGFD(unit))<=40',nil,true)
local yexing = msFGC(30,YX)

function emNum(targets)
   local Num = 1
   local tgtable_10 = msGetUnits(true,true,30,targets)
   if tgtable_10 ~= nil then
      for i=1,#tgtable_10 do
         if UnitIsVisible(tgtable_10) and UnitExists(tgtable_10) and UnitCanAttack("player",tgtable_10) and not UnitIsDeadOrGhost(tgtable_10) then
            Num = Num + 1
         end
      end
   end
   return Num
end

local mg = msFGC(10)
local TANKS = msFindUnit('UnitGroupRolesAssigned(unit) == "TANK" and not UnitIsDeadOrGhost(unit) and UnitCanAssist("player",unit) and msGFD(unit)<=40 and msII(unit)',nil,true)
local tank,tank_hp = msGetMin('msGFD(unit)<=40',nil,TANKS)
--没有生命绽放的TANKS
local not_smzf_T,not_smzf_T_hp = msGetMin('not msGUB("生命绽放",unit,"player") and msGHP(unit)<99',nil,TANKS)
--没有生命绽放的队友
local not_smzf_p = msFindUnit('UnitCanAssist("player",unit) and not msGUB("生命绽放",unit,"player") and msII(unit) and msGHP(unit)<95 and msGFD(unit)<=40',nil,true)
--没有生命绽放血量最低的队友
local minnot_smzf_p,minnot_smzf_p_hp = msGetMin('msGFD(unit)<=40',nil,not_smzf_p)
--有生命绽放的队友
local yes_smzf = msFindUnit('UnitCanAssist("player",unit) and msGUB("生命绽放",unit,"player") and msII(unit) and msGHP(unit)<95 and msGFD(unit)<=40',nil,true)
local first
if UnitExists("targettarget") and UnitCanAssist("player","targettarget") then
   first = "targettarget"
elseif UnitExists("focus") and UnitCanAssist("player","focus") then
   first = "focus"   
else
   first = "player"
end

--tg_smzf 生命绽放的目标
local tg_smzf = {};
if grouptype == "party" then
   if TANKS then
      tg_smzf = TANKS
   end
elseif grouptype == "raid" then
   if UnitExists("targettarget") and not UnitIsDeadOrGhost("targettarget") and UnitCanAssist("player","targettarget") and msII("targettarget")
   and UnitGroupRolesAssigned("targettarget") == "TANK" and msGFD("targettarget")<=40 then
      table.insert(tg_smzf,"targettarget");
   end
   if UnitExists("focus") and not UnitIsDeadOrGhost("focus") and UnitCanAssist("player","focus") and msII("focus") and select(2,msGFD("focus"))<=40 then
      table.insert(tg_smzf,"focus");
   end   
end   
if tg_smzf and #tg_smzf>=2 then
   if UnitGUID(tg_smzf) == UnitGUID(tg_smzf) then
      table.remove(tg_smzf,2);
   end
end
if tg_smzf and #tg_smzf<2 then
   if not_smzf_T then
      if not_smzf_T_hp<80 and not tContains(tg_smzf,not_smzf_T) then
         table.insert(tg_smzf,not_smzf_T);
      elseif not_smzf_T_hp>=80 and minnot_smzf_p and minnot_smzf_p*2<=not_smzf_T_hp and not tContains(tg_smzf,minnot_smzf_p) then
         table.insert(tg_smzf,minnot_smzf_p);
      end
   elseif minnot_smzf_p and not tContains(tg_smzf,minnot_smzf_p) then
      table.insert(tg_smzf,minnot_smzf_p);
   end            
end
if msGHP() < 40 and msISC("树皮术") then
   msR("树皮术")
end
if msGHP() < 40 and msISC("铁木树皮") then
   msR("铁木树皮")
end
if msGHP() < 30 and msISC("治疗石") then
   msR("治疗石")
end
if msICM("源生") or msICM("宁静") then
   return;
end

if msICS("player","宁静") then
   return;
end

if tg_smzf and #tg_smzf>=1 then
   if not yes_smzf then
      if tg_smzf and tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") then
         msR("生命绽放",tg_smzf)
         return;
      end
      if tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") then
         msR("生命绽放",tg_smzf)
         return;
      end
   end
   if yes_smzf and #yes_smzf==1 then
      if tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") and msGUB("生命绽放",tg_smzf,"player") then
         msR("生命绽放",tg_smzf)
         return;
      end
      if tg_smzf and msISC("生命绽放",tg_smzf) and not msGUB("生命绽放",tg_smzf,"player") and msGUB("生命绽放",tg_smzf,"player")then
         msR("生命绽放",tg_smzf)
         return;
      end
   end
   if yes_smzf and #yes_smzf==2 then
      if tg_smzf and msISC("生命绽放",tg_smzf) and msGBT("生命绽放",tg_smzf,"player")<=2 and (msGBT("生命绽放",yes_smzf,"player")<=2 or msGBT("生命绽放",yes_smzf,"player")<=2) then
         msR("生命绽放",tg_smzf)
         return;
      end
      if tg_smzf and msISC("生命绽放",tg_smzf) and msGBT("生命绽放",tg_smzf,"player")<=2and (msGBT("生命绽放",yes_smzf,"player")<=2 or msGBT("生命绽放",yes_smzf,"player")<=2) then
         msR("生命绽放",tg_smzf)
         return;
      end
   end
end

if yexing and emNum(yexing) > 3 and msISC("野性成长") and msGUB("丛林之魂") then
   msR("野性成长",yexing)
end
if yexing and emNum(yexing) > 4 and msISC("野性成长") then
   msR("野性成长",yexing)
end

逆天修罗 发表于 2016-5-8 21:25:47

追悼者 发表于 2016-5-8 21:23
看不出来,你这表添加删除得挺复杂的

能帮忙改下吗????????????

老胡 发表于 2016-5-12 15:10:57

代码太长,硬看太费时间了,把代码拷贝到在线编辑框里面运行一下,看看会不会报错。

断青丝 发表于 2016-5-12 15:54:58

好长的代码,看着眼睛都花了

浪贼妖 发表于 2016-5-12 23:13:11

逆天修罗 发表于 2016-5-8 21:20
local grouptype=""
if GetNumGroupMembers()>5 then
   grouptype="raid"


这个就是我发的 恢复德脚本呀。我用着一直没问题。治疗量很高。我估计你没插生命绽放雕文。 你插个试试
页: [1]
查看完整版本: 再次求教。。。。