LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
查看: 1791|回复: 5

[MS] 再次求教。。。。

[复制链接]
发表于 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[1]) == UnitGUID(tg_smzf[2]) 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[1] and tg_smzf[1] and msISC("生命绽放",tg_smzf[1]) and not msGUB("生命绽放",tg_smzf[1],"player") then
         msR("生命绽放",tg_smzf[1])
         return;
      end
      if tg_smzf[2] and msISC("生命绽放",tg_smzf[2]) and not msGUB("生命绽放",tg_smzf[2],"player") then
         msR("生命绽放",tg_smzf[2])
         return;
      end
   end
   if yes_smzf and #yes_smzf==1 then
      if tg_smzf[1] and msISC("生命绽放",tg_smzf[1]) and not msGUB("生命绽放",tg_smzf[1],"player") and msGUB("生命绽放",tg_smzf[2],"player") then
         msR("生命绽放",tg_smzf[1])
         return;
      end
      if tg_smzf[2] and msISC("生命绽放",tg_smzf[2]) and not msGUB("生命绽放",tg_smzf[2],"player") and msGUB("生命绽放",tg_smzf[1],"player")  then
         msR("生命绽放",tg_smzf[2])
         return;
      end
   end
   if yes_smzf and #yes_smzf==2 then
      if tg_smzf[1] and msISC("生命绽放",tg_smzf[1]) and msGBT("生命绽放",tg_smzf[1],"player")<=2 and (msGBT("生命绽放",yes_smzf[1],"player")<=2 or msGBT("生命绽放",yes_smzf[2],"player")<=2) then
         msR("生命绽放",tg_smzf[1])
         return;
      end
      if tg_smzf[2] and msISC("生命绽放",tg_smzf[2]) and msGBT("生命绽放",tg_smzf[2],"player")<=2  and (msGBT("生命绽放",yes_smzf[1],"player")<=2 or msGBT("生命绽放",yes_smzf[2],"player")<=2) then
         msR("生命绽放",tg_smzf[2])
         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
if  UnitIsDeadOrGhost("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[1]) == UnitGUID(tg_smzf[2]) 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[1] and tg_smzf[1] and msISC("生命绽放",tg_smzf[1]) and not msGUB("生命绽放",tg_smzf[1],"player") then
         msR("生命绽放",tg_smzf[1])
         return;
      end
      if tg_smzf[2] and msISC("生命绽放",tg_smzf[2]) and not msGUB("生命绽放",tg_smzf[2],"player") then
         msR("生命绽放",tg_smzf[2])
         return;
      end
   end
   if yes_smzf and #yes_smzf==1 then
      if tg_smzf[1] and msISC("生命绽放",tg_smzf[1]) and not msGUB("生命绽放",tg_smzf[1],"player") and msGUB("生命绽放",tg_smzf[2],"player") then
         msR("生命绽放",tg_smzf[1])
         return;
      end
      if tg_smzf[2] and msISC("生命绽放",tg_smzf[2]) and not msGUB("生命绽放",tg_smzf[2],"player") and msGUB("生命绽放",tg_smzf[1],"player")  then
         msR("生命绽放",tg_smzf[2])
         return;
      end
   end
   if yes_smzf and #yes_smzf==2 then
      if tg_smzf[1] and msISC("生命绽放",tg_smzf[1]) and msGBT("生命绽放",tg_smzf[1],"player")<=2 and (msGBT("生命绽放",yes_smzf[1],"player")<=2 or msGBT("生命绽放",yes_smzf[2],"player")<=2) then
         msR("生命绽放",tg_smzf[1])
         return;
      end
      if tg_smzf[2] and msISC("生命绽放",tg_smzf[2]) and msGBT("生命绽放",tg_smzf[2],"player")<=2  and (msGBT("生命绽放",yes_smzf[1],"player")<=2 or msGBT("生命绽放",yes_smzf[2],"player")<=2) then
         msR("生命绽放",tg_smzf[2])
         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"

这个就是我发的 恢复德脚本呀。我用着一直没问题。治疗量很高。我估计你没插生命绽放雕文。 你插个试试
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2024-5-5 12:01 AM , Processed in 0.152139 second(s), 25 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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