WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   auto take screenshot when bg/arena finished (https://www.wowinterface.com/forums/showthread.php?t=46690)

devilArt 06-20-13 12:53 PM

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)

Malsomnus 06-20-13 01:42 PM

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.

Dridzt 06-20-13 03:49 PM

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.

devilArt 06-21-13 03:43 AM

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"

Dridzt 06-21-13 04:40 AM

Quote:

Originally Posted by devilArt (Post 280071)
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.

devilArt 06-21-13 05:29 PM

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)


All times are GMT -6. The time now is 01:58 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI