function RaidDispelDelay(t,buff,d) --t: dispel spell id, d: delay seconds
for i=1, #members do
for j=1, #buff do
local RDDname, RDDrank, RDDicon, RDDcount, RDDdebuffType, RDDduration, RDDexpirationTime, RDDunitCaster, RDDisStealable, RDDshouldConsolidate, RDDspellId = UnitDebuffID(members[i].Unit, buff[j])
if RDDname then
if IsSpellInRange(GetSpellInfo(t),members[i].Unit) == 1
and not PQR_IsOutOfSight(members[i].Unit)
and PQR_SpellAvailable(t)
and ValidDispel(members[i].Unit)
and select(2,GetSpellCooldown(t)) < 2
and ((RDDduration - (RDDexpirationTime - GetTime())) >= d) --debuff time left
--and CanHeal(members[i].Unit)
and IsUsableSpell(t) then
CastSpellByName(tostring(GetSpellInfo(t)),members[i].Unit)
--return true --Silent cast
end
end
end
end
end
---------
Example: RaidDispelDelay(1044,122,0.2)