PhotoOp

Takes a picture when interesting events occur.

Essentially an Ace3 remake of the PhotoOp addon. However, functionality that was previously builtin to the addon is now implemented as user modifiable Lua scripts.

Scripts are segments of Lua code that use a Script Api to determine when to take pictures.

Default scripts include:

  • Death
  • Duels
  • Gaining a level
  • High crits

Options are accessed through /po or /photoop.

See Default Scripts for a list of builtin scripts.

Creating a new script

  1. Open up the options interface (either /po or navigate through the blizzard potions menu)
  2. Select "User Scripts" > "New"
  3. Enter a unique name, a description and the desired events
  4. Hit the create button (This may generate an error in AceGUI atm)
  5. The script sub panel should open with the newly created script selected. Edit the script to taste and hit the apply button. (Not sure where errors go at this point)

Examples

If you think a script should be included by default (or have fixes), please post to Default Scripts.

I will add requested / submitted scripts here until this short list becomes a long list (at which point we can have a separate page for scripts).

Player death

This script takes a picture when the player's character dies. Additionally it keeps track of whether the player is in a battleground and depending on settings will not take a picture in those zones.

-- $EVENTS PLAYER_DEAD ZONE_CHANGED_NEW_AREA
-- $DESCRIPTION Take a picture when dying
-- $SETTING InBattlegrounds = "boolean"
local event = ...
if "PLAYER_DEAD" == event then
  if nil == self.inBattleground then
    self.inBattleground = 0 < GetBattlefieldInstanceRuntime()
  end
  if not self.inBattleground or settings.InBattlegrounds then
    TakeScreenshot()
  end
elseif "ZONE_CHANGED_NEW_AREA" == event then
  self.inBattleground = 0 < GetBattlefieldInstanceRuntime()
end

A similar script is included as a default script (uses IsInInstance and checks for arenas too).

Achievement

This simply registers for the ACHIEVEMENT_EARNED event and takes a screenshot when that happens.

-- $EVENTS ACHIEVEMENT_EARNED
-- $DESCRIPTION Earned an Achievement
TakeScreenshot()

TODO

  • Databroker interface
  • Countdown to taking the screenshot
  • Add missing global functions

You must login to post a comment. Don't have an account? Register to get one!

  • 4 comments
  • Avatar of dicklee dicklee Sun, 11 Oct 2009 10:19:34

    i use version r139 and try to rewrite a line

    LibUserScript-1.0.lua

    line 375:

    math.randomseed = math.random(0, 2^31 - 1) + (GetTime() * 1000);

    Last edited on 11 Oct 2009 by dicklee
  • Avatar of doperyde doperyde Thu, 07 May 2009 21:50:01

    copying this from the curse addon page:

    I've really enjoyed this add-on since achievments were introduced. It let me be lazy and was much better at getting screenshots off faster than I am. Recently (since the last small patch a couple weeks ago), it has stopped working. The error(s) are below:

    Date: 2009-05-07 15:04:06
    ID: 1
    Error occured in: Global
    Count: 1
    Message: ...PhotoOp\Libs\LibUserScript-1.0\LibUserScript-1.0.lua line 375:
    attempt to call field 'randomseed' (a nil value)
    Debug:
    (tail call): ?
    ...PhotoOp\Libs\LibUserScript-1.0\LibUserScript-1.0.lua:375 New()
    PhotoOp\Core.lua:111
    PhotoOp\Core.lua:102
    (tail call): ?
    [C]: ?
    [string "safecall Dispatcher[1]"]:9:
    [string "safecall Dispatcher[1]"]:5
    (tail call): ?
    ...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:502 InitializeAddon()
    ...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:614
    ...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:607
    AddOns:
    Swatter, v3.1.13 ()
    agExtras, vr707
    agUnitFrames, vr707
    Bartender4, v4.3.2
    ChatMOD, v133
    PhotoOp, vr139
    (ck=80)

    -----------------------------

    Date: 2009-05-07 15:04:13
    ID: 2
    Error occured in: Global
    Count: 1
    Message: ..\AddOns\PhotoOp\Core.lua line 272:
    attempt to index field 'db' (a nil value)
    Debug:
    (tail call): ?
    PhotoOp\Core.lua:272 GetCapture()
    PhotoOp\Core.lua:149 LoadProfile()
    PhotoOp\Core.lua:134
    PhotoOp\Core.lua:133
    (tail call): ?
    [C]: ?
    [string "safecall Dispatcher[1]"]:9:
    [string "safecall Dispatcher[1]"]:5
    (tail call): ?
    ...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:531 EnableAddon()
    ...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:621
    ...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:607
    [C]: LoadAddOn()
    ..\FrameXML\UIParent.lua:229 UIParentLoadAddOn()
    ..\FrameXML\UIParent.lua:252 CombatLog_LoadUI()
    ..\FrameXML\UIParent.lua:497
    ..\FrameXML\UIParent.lua:469
    AddOns:
    Swatter, v3.1.13 ()
    agExtras, vr707
    agUnitFrames, vr707
    Bartender4, v4.3.2
    ChatMOD, v133
    PhotoOp, vr139
    (ck=80)

    ---------------------

    I haven't tried disabling AG Unit Frames yet as I've had problems when disabling it that it resets the profiles. I will try that now. I'm not sure where the problem is at between PhotoOP, AG, or possibly ACE or LibUserScript. I installed the standalone libraries for ACE and LubUserScript and when doing that the errors then occured within them and not within what appears to be PhotoOP.
    Would love to help resolve this issue if possible.

    After disabling all addons, except for PhotoOp and Swatter:

    Date: 2009-05-07 15:19:58
    ID: -1
    Error occured in: Global
    Count: 1
    Message: ..\AddOns\PhotoOp\Core.lua line 272:
    attempt to index field 'db' (a nil value)
    Debug:
    (tail call): ?
    PhotoOp\Core.lua:272 GetCapture()
    PhotoOp\Core.lua:149 LoadProfile()
    PhotoOp\Core.lua:134
    PhotoOp\Core.lua:133
    (tail call): ?
    [C]: ?
    [string "safecall Dispatcher[1]"]:9:
    [string "safecall Dispatcher[1]"]:5
    (tail call): ?
    ...ce\AddOns\PhotoOp\Libs\AceAddon-3.0\AceAddon-3.0.lua:365 EnableAddon()
    ...ce\AddOns\PhotoOp\Libs\AceAddon-3.0\AceAddon-3.0.lua:435
    ...ce\AddOns\PhotoOp\Libs\AceAddon-3.0\AceAddon-3.0.lua:421
    [C]: LoadAddOn()
    ..\FrameXML\UIParent.lua:229 UIParentLoadAddOn()
    ..\FrameXML\UIParent.lua:252 CombatLog_LoadUI()
    ..\FrameXML\UIParent.lua:497
    ..\FrameXML\UIParent.lua:469
    AddOns:
    Swatter, v3.1.13 ()
    PhotoOp, vr139
    (ck=33)

    -----------------------------

    Date: 2009-05-07 15:19:47
    ID: -2
    Error occured in: Global
    Count: 1
    Message: ...PhotoOp\Libs\LibUserScript-1.0\LibUserScript-1.0.lua line 375:
    attempt to call field 'randomseed' (a nil value)
    Debug:
    (tail call): ?
    ...PhotoOp\Libs\LibUserScript-1.0\LibUserScript-1.0.lua:375 New()
    PhotoOp\Core.lua:111
    PhotoOp\Core.lua:102
    (tail call): ?
    [C]: ?
    [string "safecall Dispatcher[1]"]:9:
    [string "safecall Dispatcher[1]"]:5
    (tail call): ?
    ...ce\AddOns\PhotoOp\Libs\AceAddon-3.0\AceAddon-3.0.lua:340 InitializeAddon()
    ...ce\AddOns\PhotoOp\Libs\AceAddon-3.0\AceAddon-3.0.lua:428
    ...ce\AddOns\PhotoOp\Libs\AceAddon-3.0\AceAddon-3.0.lua:421
    AddOns:
    Swatter, v3.1.13 ()
    PhotoOp, vr139
    (ck=33)

    So it appears that there is an issue in the embedded ACE library?

    I installed the ACE3 library as well as LibUserScript and here are the errors with such:

    Date: 2009-05-07 15:27:12
    ID: 2
    Error occured in: Global
    Count: 1
    Message: ..\AddOns\PhotoOp\Core.lua line 272:
    attempt to index field 'db' (a nil value)
    Debug:
    (tail call): ?
    PhotoOp\Core.lua:272 GetCapture()
    PhotoOp\Core.lua:149 LoadProfile()
    PhotoOp\Core.lua:134
    PhotoOp\Core.lua:133
    (tail call): ?
    [C]: ?
    [string "safecall Dispatcher[1]"]:9:
    [string "safecall Dispatcher[1]"]:5
    (tail call): ?
    Ace3\AceAddon-3.0\AceAddon-3.0.lua:531 EnableAddon()
    Ace3\AceAddon-3.0\AceAddon-3.0.lua:621
    Ace3\AceAddon-3.0\AceAddon-3.0.lua:607
    [C]: LoadAddOn()
    ..\FrameXML\UIParent.lua:229 UIParentLoadAddOn()
    ..\FrameXML\UIParent.lua:252 CombatLog_LoadUI()
    ..\FrameXML\UIParent.lua:497
    ..\FrameXML\UIParent.lua:469
    AddOns:
    Swatter, v3.1.13 ()
    Ace3, v
    LibUserScript10, vv1.0.4
    PhotoOp, vr139
    (ck=58)

    -----------------------------

    Date: 2009-05-07 15:27:05
    ID: 1
    Error occured in: Global
    Count: 1
    Message: ...erScript-1.0\LibUserScript-1.0\LibUserScript-1.0.lua line 375:
    attempt to call field 'randomseed' (a nil value)
    Debug:
    (tail call): ?
    ...erScript-1.0\LibUserScript-1.0\LibUserScript-1.0.lua:375 New()
    PhotoOp\Core.lua:111
    PhotoOp\Core.lua:102
    (tail call): ?
    [C]: ?
    [string "safecall Dispatcher[1]"]:9:
    [string "safecall Dispatcher[1]"]:5
    (tail call): ?
    Ace3\AceAddon-3.0\AceAddon-3.0.lua:502 InitializeAddon()
    Ace3\AceAddon-3.0\AceAddon-3.0.lua:614
    Ace3\AceAddon-3.0\AceAddon-3.0.lua:607
    AddOns:
    Swatter, v3.1.13 ()
    Ace3, v
    LibUserScript10, vv1.0.4
    PhotoOp, vr139
    (ck=58)

    It's also worth noting that I did a "clean" install of PhotoOp, removing the addon folders and the .lua files within the WTF folder as well. I also don't use any kind of custom scripts for taking any screenshots. I use only what is given with it by default.

  • Avatar of leelomay leelomay Sun, 26 Apr 2009 13:57:25

    after 3.1 update, I got errors like this --

    1) PhotoOp-v0.8.6.1\Core.lua:272: attempt to index field 'db' (a nil value) PhotoOp-v0.8.6.1\Core.lua:149: in function `LoadProfile' PhotoOp-v0.8.6.1\Core.lua:134: in function <Interface\AddOns\PhotoOp\Core.lua:133> (tail call): ?: <in C code>: ? <string>:"safecall Dispatcher[1]":9: in function <[string "safecall Dispatcher[1]"]:5> (tail call): ?: AceAddon-3.0-5 (ag_UnitFrames):531: in function `EnableAddon' AceAddon-3.0-5 (ag_UnitFrames):621: in function <...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:607> <in C code>: in function `LoadAddOn' Interface\FrameXML\UIParent.lua:229: in function `UIParentLoadAddOn': Interface\FrameXML\UIParent.lua:252: in function `CombatLog_LoadUI': Interface\FrameXML\UIParent.lua:497: in function <Interface\FrameXML\UIParent.lua:469>:

    2) LibUserScript-1.0-133:375: attempt to call field 'randomseed' (a nil value) PhotoOp-v0.8.6.1\Core.lua:111: in function <Interface\AddOns\PhotoOp\Core.lua:102> (tail call): ?: <in C code>: ? <string>:"safecall Dispatcher[1]":9: in function <[string "safecall Dispatcher[1]"]:5> (tail call): ?: AceAddon-3.0-5 (ag_UnitFrames):502: in function `InitializeAddon' AceAddon-3.0-5 (ag_UnitFrames):614: in function <...Ons\ag_UnitFrames\libs\AceAddon-3.0\AceAddon-3.0.lua:607>

    Is it conflicted with aguf? Thx for checking this awesome addon

  • Avatar of hillie hillie Sun, 23 Nov 2008 00:31:53

    This sounds pretty cool. it's so hard to get those screenshots of really high crits and stuff, and some of the stuff you can't repeat.

  • 4 comments

Facts

Date created
18 Nov 2007
Category
Last update
04 Dec 2008
Development stage
Release
Language
  • enUS
License
GNU General Public License version 3 (GPLv3)
Curse link
PhotoOp
Recent files
  • A: r139 for 3.0.3 on 04 Dec 2008
  • A: r138 for 3.0.3 on 02 Dec 2008
  • A: r134 for 3.0.3 on 02 Dec 2008
  • R: v0.8.6.1 for 3.0.3 on 24 Nov 2008
  • R: v0.8.6 for 3.0.3 on 23 Nov 2008

Authors

Relationships

Embedded library
Ace3
CallbackHandler-1.0
LibUserScript