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