Originally Posted by
paintpauller
any idea on how to check if a spell was successfully cast? trying to make some simple code to both take advantage of double jeopardy and keep Censure up on my focus.
here is what i have so far, it will only cast on my focus because JudgOnTarget is never being set true. ignore the prints they are there for debugging =p
So I already responded to paint in a PM but just for anyone else who wants to see for his check on the successful cast you could work with what I did. I am giving credit to the nova team on the main part to me getting this, which is what bubba put out for his mistweaver check a while ago.
Long story short though my code was made for my combat rogue profile to check how many times sinister strike and or revealing strike have been cast while the moderate insight buff was up and active. Here's what I have and have it working:
Code:
if UnitBuffID("player", MODERATEINSIGHT) == nil then
CheckForDeep = 0
end
if CombatLog == nil then
Nova_CombatLog = CreateFrame('Frame')
Nova_CombatLog:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
function CombatLog_OnEvent(self, event, ...)
local type, _, sourceGUID, sourceNAME, _, _, destGUID, destNAME = select(2, ...)
if (event=="COMBAT_LOG_EVENT_UNFILTERED") then
if sourceNAME ~= UnitName("player") then --Could add in a "if destGUID ~= UnitGUID("focus") then"
return false
end
if type == "SPELL_DAMAGE" and ( select(12, ...) == 1752 or select(12, ...) == 84617 ) then --It'll trigger if there was any damage either sinister strike, or revealing strike
CheckForDeep = CheckForDeep + 1
elseif type == "SPELL_AURA_REMOVED" and ( select(12, ...) == 84745 or select(12, ...) == 84746 or select(12, ...) == 84747 ) then --will set the counter back to 0 if any of the 3 buffs were lost
CheckForDeep = 0
end
end
end
Nova_CombatLog:SetScript("OnEvent", CombatLog_OnEvent)
CombatLog = true
end
and then after it has the check the application for it was in my spell for slice and dice, so when I had the buff moderate insight, and was at 3 sucsessful hits from either sinister strike or revealing strike to cast slice and dice again:
Code:
if AoE and FanOK == 1 then
return false
end
if ( not HasBuff(SLICEANDDICE)
or ( BuffTime(SLICEANDDICE) < 2
or ( BuffTime(SLICEANDDICE) < 15
and CheckForDeep == 3
and GetComboPoints("player", "target") >= 4 ) ) ) then
Cast(SLICEANDDICE)
end