Hey I almost have double jeopardy fixed but I need a little more help, it won't cast judgment at all and I' not sure why.
PHP Code:
--Censure time/stack check for double jeoparady
local tCensure = (select(7, UnitDebuffID("target", 31803, "player")))
local fCensure = (select(7, UnitDebuffID("focus", 31803, "player")))
-- Judgment
if hasSeal and UnitPower("player", 9) < 5 then
if UnitExists("focus") and RangeCheck(20271, "focus") then
if not fCensure or select(7, UnitDebuffID("target", 31803, "player")) - GetTime() > select(7, UnitDebuffID("focus", 31803, "player")) - GetTime() then
CastSpellByName(GetSpellInfo(20271), "focus")
end
elseif UnitExists("target") and RangeCheck(20271, "target") then
if not tCensure or select(7, UnitDebuffID("target", 31803, "player")) - GetTime() < select(7, UnitDebuffID("focus", 31803, "player")) - GetTime() then
CastSpellByName(GetSpellInfo(20271), "target")
end
end
I was trying tCensure - GetTime() and the same for fCensure but I got the error, can't do arithmetic on a nil value.
I also had an else between focus and target logic but I changed it to an elseif, because I need to throw in a glyph check when this works, so people without the glyph can still use it.