I appreciate it!
I've re-eingeered the code to fit my specifications.
It now only increases counter on a refresh and in combat.
It now resets the counter when you refresh mark of the wild on yourself AND you are out of combat
Code:
function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
if message == "SPELL_AURA_REFRESH" then
local spellId, spellName, spellSchool = ...
if sourceName == UnitName("player") and spellId == 1126 then
if UnitAffectingCombat("player") == nil then
if not WeakAuraSScount or not WeakAuraSSdamage then
WeakAuraSScount = 0
WeakAuraSSdamage = 0
end
print("Since last combat:")
print(WeakAuraSScount.. " SS procs refreshed")
ratio = WeakAuraSScount/WeakAuraSSdamage
ratio = ratio * 100
if WeakAuraSSdamage == 0 then
ratio = 0
end
print("SS loss: ".. math.floor(ratio*math.pow(10,2)+0.5) / math.pow(10,2).. "%")
print("SS Count reset")
WeakAuraSScount = 0
WeakAuraSSdamage = 0
end
end
if UnitAffectingCombat("player") == 1 then
if sourceName == UnitName("player") and spellId == 93400 then
WeakAuraSScount = WeakAuraSScount + 1
end
end
end
if message == "SPELL_DAMAGE" then
local spellId, spellName, spellSchool = ...
if sourceName == UnitName("player") and spellName == "Starsurge" then
WeakAuraSSdamage = WeakAuraSSdamage + 1
end
end
end
EDIT:
One last change. Instead of making it print each refresh, I am now only printing when I am resetting so I know how much was done since last reset.
Need to add a check if the variable exists, accidently deleted it.. but doing more edits right now so I'll have something else up soon.
FINAL EDIT:
Finished. Now also prints out truncated percentage of lost shooting stars procs to successful starsurge casts.