Advertisement
Guest User

Reju/Smartmend Macro

a guest
Nov 19th, 2018
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. /script s1="Rejuvenation" s2="Regrowth" s3="Swiftmend" if (VGRT_TLTP == nil) then CreateFrame("GameTooltip","VGRT_TLTP",nil,"GameTooltipTemplate") VGRT_TLTP:SetOwner(WorldFrame,"ANCHOR_NONE") end function VGRT_CastSpellWithCheck(tar) c=0 i=1 while (UnitBuff(tar,i) ~= nil) do VGRT_TLTP:SetUnitBuff(tar,i) if (strfind(VGRT_TLTPTextLeft1:GetText(),s1) ~= nil) then c=1 break elseif (strfind(VGRT_TLTPTextLeft1:GetText(),s2) ~= nil) then c=2 end i=i+1 end local smOffCd = false local j=1 local _, smCd, _ while true do local spellName, spellRank = GetSpellName(j, BOOKTYPE_SPELL) if not spellName then do break end end if spellName == s3 then _, smCd, _ = GetSpellCooldown(j, BOOKTYPE_SPELL) if(smCd == 0) then smOffCd = true end break end j = j + 1 end if (c==0) then CastSpellByName(s1) elseif(UnitHealth(tar)/UnitHealthMax(tar)<=0.65) then if(smOffCd) then CastSpellByName("Swiftmend") elseif(c~=1) then CastSpellByName(s1) end elseif (c==2) then CastSpellByName(s1) end end if GetMouseFocus().unit then if UnitIsUnit("target", GetMouseFocus().unit) then VGRT_CastSpellWithCheck("target") else TargetUnit(GetMouseFocus().unit) VGRT_CastSpellWithCheck("target") TargetLastTarget() end else if (UnitName("target")==nil) then VGRT_CastSpellWithCheck("player") else VGRT_CastSpellWithCheck("target") end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement