Thread Tools Display Modes
06-20-13, 12:53 PM   #1
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 51
auto take screenshot when bg/arena finished

i took these code from shestakui, it could auto take a screenshot when you earned a achievement, but I want it auto take a screenshot when bg/arena finished too, is there anyone know how to modify it?


Lua Code:
  1. local function TakeScreen(delay, func, ...)
  2.     local waitTable = {}
  3.     local waitFrame = CreateFrame("Frame", "WaitFrame", UIParent)
  4.     waitFrame:SetScript("onUpdate", function (self, elapse)
  5.         local count = #waitTable
  6.         local i = 1
  7.         while (i <= count) do
  8.             local waitRecord = tremove(waitTable, i)
  9.             local d = tremove(waitRecord, 1)
  10.             local f = tremove(waitRecord, 1)
  11.             local p = tremove(waitRecord, 1)
  12.             if d > elapse then
  13.                 tinsert(waitTable, i, {d-elapse, f, p})
  14.                 i = i + 1
  15.             else
  16.                 count = count - 1
  17.                 f(unpack(p))
  18.             end
  19.         end
  20.     end)
  21.     tinsert(waitTable, {delay, func, {...} })
  22. end
  23.  
  24. local function OnEvent(...)
  25.     TakeScreen(1, Screenshot)
  26. end
  27.  
  28. local frame = CreateFrame("Frame")
  29. frame:RegisterEvent("ACHIEVEMENT_EARNED")
  30. frame:SetScript("OnEvent", OnEvent)
  Reply With Quote
06-20-13, 01:42 PM   #2
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
http://wowprogramming.com/docs/event...SYSTEM_NEUTRAL
I think that this event will allow you to respond to the end of a battleground. If there's a similar event for arenas, I haven't managed to find it yet, though it might be possible that this one will work for them as well.
  Reply With Quote
06-20-13, 03:49 PM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Not what you asked for specifically but I'm pretty sure I put BG/Arena screenshots in MultiShot in latest version.

Haven't really tested as I don't pvp much.
  Reply With Quote
06-21-13, 03:43 AM   #4
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 51
hi dridzt
I tested multishot, achievement auto screenshot works well, but it can't auto take screenshot when arena fineshed, didn't test bg yet
i guess there is no a specific event like "ACHIEVEMENT_EARNED" for arena and bg finish, i notice there is a system message when arena/bg finished like "xxx won"
  Reply With Quote
06-21-13, 04:40 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Originally Posted by devilArt View Post
hi dridzt
I tested multishot, achievement auto screenshot works well, but it can't auto take screenshot when arena fineshed, didn't test bg yet
i guess there is no a specific event like "ACHIEVEMENT_EARNED" for arena and bg finish, i notice there is a system message when arena/bg finished like "xxx won"
Theoretically it would only take screenshot on Arena win or draw (not on losses) did you have one of those while testing it?
You also need to check if the option is enabled I don't remember if I have it checked by default on new installations.

Like I said that part is mostly drycoded as I don't do arenas, but if you can verify that it's not working for win/draw with the option selected I'll see what I can do to fix it.
  Reply With Quote
06-21-13, 05:29 PM   #6
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 51
tested again, multishot didn't auto take screenshot when I won an arena match, i do enabled the option

btw, could you make it auto take screenshot whether win draw or lose (arena and BG/RBG)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » auto take screenshot when bg/arena finished

Thread Tools
Display Modes

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