Hi,
I want to keep a diary of my WoW run and thought it would be funny to have a printscreen everytime I level up.
I try to make an (very simple) addon for this but the Screenshot is giving me some headache.
Can anyone tell me what I have done wrong or point me in the right direction?
When I use
Code:
local Congrats_EventFrame = CreateFrame("Frame")
Congrats_EventFrame:RegisterEvent("PLAYER_LEVEL_UP")
Congrats_EventFrame:SetScript("OnEvent",
function(self, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ...
print(Congratulations on reaching level ' ..arg1.. ', ' .. UnitName("Player").. '! You gained ' ..arg2.. ' HP and ' ..arg3.. ' MP!')
end)
It works.
So I thought about adding the printscreen function like this:
Code:
local Congrats_EventFrame = CreateFrame("Frame")
Congrats_EventFrame:RegisterEvent("PLAYER_LEVEL_UP")
Congrats_EventFrame:SetScript("OnEvent",
function(self, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ...
print(Congratulations on reaching level ' ..arg1.. ', ' .. UnitName("Player").. '! You gained ' ..arg2.. ' HP and ' ..arg3.. ' MP!')
end)
Congrats_EventFrame:SetScript("OnEvent",
function(self, event, ...)
local Screenshot
end)
But that doesn't work.
So if someone could point me in the right direction that would be great