Can anyone tell me why this won't work? It keeps attacking focus.
PHP Code:
-- Holy Avenger Check
if UnitBuffID("player", 105809) and UnitPower("player", 9) >= 3 then
return false
-- Wrong Spell Cast Check
elseif PQR_SpellAvailable(879) or PQR_SpellAvailable(24275) or PQR_SpellAvailable(35395) or UnitBuffID("player", 87138) then
return false
end
-- Seal Check
if GetShapeshiftForm() ~= 0 then hasSeal = true else hasSeal = false end
local fCensure, _, _, _, _, _, fCensureTime = UnitDebuffID("focus", 31803)
local tCensure, _, _, _, _, _, tCensureTime = UnitDebuffID("target", 31803)
if fCensure ~= nil then fCensureTime = fCensureTime - GetTime() end
if tCensure ~= nil then tCensureTime = tCensureTime - GetTime() end
-- Judgment
if hasSeal and UnitPower("player", 9) < 5 then
if GlyphCheck(41092) or GlyphCheck(54922) then
if UnitExists("focus") and RangeCheck(20271, "focus") then
if not fCensure or (tCensure and tCensureTime > fCensureTime) then
CastSpellByName(GetSpellInfo(20271), "focus")
end
elseif UnitExists("target") and RangeCheck(20271, "target") then
if not tCensure or (fCensure and tCensureTime < fCensureTime) then
CastSpellByName(GetSpellInfo(20271), "target")
end
end --ends if/elseif
end -- ends glyph check
else
if UnitExists("target") and RangeCheck(20271, "target") then
CastSpellByName(GetSpellInfo(20271), "target")
end
end --ends else/holypowercheck/sealcheck
nvm noticed this wont work at all because tCensure time will always be greater than fCensure