July 6, 201411 yr Ok I just through this together Im not sure if it will work can someone look at this code and tell if there is something wrong with it. I need it to check for Fire Elemental totem and Not cast if this totem is up. Im not sure how to do that. Then I can edit it to do the same thing for Magma totem. I also need this one to recast after it have run for almost a minute, say at 10 second left on the timer. if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted()) and not (IsFlying()) and not (IsFalling()) and not (IsResting()) and not (UnitIsAFK("player")) then local timeLeftToCastAgain = 10*60; local idTotem={3599} --[[ Searing Totem ]] idTotem[1]={3599} local now=GetTime(10); for i=1,#idTotem do local TotemFound=0 spellname=GetSpellInfo(idTotem) local haveTotem, totemName, startTime, duration = GetTotemInfo(1); if (haveTotem) then local expireTimeLeft = expirationTime-now; TotemFound=idTotem if (expireTimeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); spell=spellname; end end end break; end end
July 15, 201411 yr Hi, I cannot test but try this code I have correct some errors. if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted()) and not (IsFlying()) and not (IsFalling()) and not (IsResting()) and not (UnitIsAFK("player")) then local timeLeftToCastAgain = 10*60; --[[ Searing Totem ]] local idTotem={3599} for i=1,#idTotem do local spellname=GetSpellInfo(idTotem[i]) for totemIndex=1,4 do local haveTotem, totemName, startTime, duration = GetTotemInfo(totemIndex); if (haveTotem and spellname == totemName) then local timeLeft = startTime+duration-GetTime(); if (timeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); end end end break; end end end end
July 22, 201411 yr Author Ok so is this how I get it to fire??? with the research needed? if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted()) and not (IsFlying()) and not (IsFalling()) and not (IsResting()) and not (UnitIsAFK("player")) then local timeLeftToCastAgain = 10*60; --[[ Searing Totem ]] local idTotem={3599} for i=1,#idTotem do local spellname=GetSpellInfo(idTotem[i]) for totemIndex=1,4 do local haveTotem, totemName, startTime, duration = GetTotemInfo(totemIndex); if (haveTotem and spellname == totemName) then local timeLeft = startTime+duration-GetTime(); if (timeLeft < timeLeftToCastAgain) then if (IsUsableSpell(spellname)) then local start, duration, enable = GetSpellCooldown(spellname) if (duration==0) then CastSpellByName(spellname); end end end break; end end end end result = (HaveTotem = 0)
Create an account or sign in to comment