Thread Tools Display Modes
11-14-08, 12:41 PM   #1
LordHades
A Defias Bandit
Join Date: Nov 2008
Posts: 2
addon help

Hi, I'm using LevelRecorder by Astromech and i wanted to add the total time played to it. i tried:
Code:
local played = 0
...
-- OnEvent handler
local OnEvent = function(self, event, level)
    if event == "PLAYER_LEVEL_UP" and level >= minlevel then
        -- Displayed /played data on the chat frame
        RequestTimePlayed()
        if event == "TIME_PLAYED_MSG" then
            -- Display message
            played = arg1
            message:SetText(getMessage(level))
            message:Show()
            -- Set up the screenshot handler for next update
            frame:Show()
        end
    else -- if event == "SCREENSHOT_SUCCEEDED" or event == "SCREENSHOT_FAILED" then
        message:Hide()
    end
end
...
frame:SetScript("OnEvent", OnEvent)
frame:SetScript("OnUpdate", OnUpdate)
frame:RegisterEvent"PLAYER_LEVEL_UP"
frame:RegisterEvent"TIME_PLAYED_MSG"
but it didn't work. I level, it shows the time in the chat but never takes the screenshot. could anyone help me or at least point me in the right direction?
  Reply With Quote
11-14-08, 12:54 PM   #2
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Your code looks nice when showing the time etc, but you never call Screenshot(), witch is needed to actually capture the screen. Just used like this;
Code:
...SomeCodeHere...
Screenshot()
...SomeMoreCodeHere...
Originally Posted by LordHades View Post
Hi, I'm using LevelRecorder by Astromech and i wanted to add the total time played to it. i tried:
Code:
local played = 0
...
-- OnEvent handler
local OnEvent = function(self, event, level)
    if event == "PLAYER_LEVEL_UP" and level >= minlevel then
        -- Displayed /played data on the chat frame
        RequestTimePlayed()
        if event == "TIME_PLAYED_MSG" then
            -- Display message
            played = arg1
            message:SetText(getMessage(level))
            message:Show()
            -- Set up the screenshot handler for next update
            frame:Show()
        end
    else -- if event == "SCREENSHOT_SUCCEEDED" or event == "SCREENSHOT_FAILED" then
        message:Hide()
    end
end
...
frame:SetScript("OnEvent", OnEvent)
frame:SetScript("OnUpdate", OnUpdate)
frame:RegisterEvent"PLAYER_LEVEL_UP"
frame:RegisterEvent"TIME_PLAYED_MSG"
but it didn't work. I level, it shows the time in the chat but never takes the screenshot. could anyone help me or at least point me in the right direction?
  Reply With Quote
11-14-08, 12:58 PM   #3
LordHades
A Defias Bandit
Join Date: Nov 2008
Posts: 2
its actually called in the OnUpdate handler but nothing after
Code:
if event == "TIME_PLAYED_MSG" then
is called for some reason
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » addon help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off