Hey i want to write a small AddOn to Track the Rapture CD for Priests. But my Problem is that i dont unterstand the lua code very well so it doesnt work right know. Can Anyone give me a hint how to solve the problem?!
Code:
function Foo_OnLoad(self)
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
function Foo_OnEvent(self, event, ...)
local timestamp, type, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, -- arg1 to arg8
spellId, spellName, spellSchool, -- arg9 to arg11
amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = ... -- arg12 to arg20
if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
if (type == "SPELL_ENERGIZE") then
local spellId, spellName, spellSchool, amount, powerType = ...
local player_name = UnitName("player")
if destName == player_name and sourceName == player_name and spellId == 47755 then
print("TESTESTESTESTEST")
end
end
end
end
local f = CreateFrame("Frame", "Foo_Frame")
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
f:SetScript("OnEvent", Foo_OnEvent)