Anyone can write a module for Auctioneer, and they're certainly welcome to do so. I'm not saying no one here will, but we have a fair number of things we're working on at the moment (at least I do) so it isn't likely to come from one of us any time soon, I think. Also, it appears that the "addon" they've produced is realm specific (meaning it appears you need a separate addon for each realm) and I don't know how that would fit within our data constructs.
I've written a stats module to allow Auctioneer to use the market data from The Undermine Journal. Is this something that anyone else wants to use? The implementation was fairly straightforward.
I do wish there was more documentation on GetItemPDF, GetPriceArray, etc., that are required parts of the interface for Stats modules. I had to guess at what should be provided by examining the maintained Stats modules that come with Auctioneer. The Auc-Stat-Example module seems a bit outdated in its documentation.
That is actually the best way to go with such a statistic; there are actually quite a few user-maintained Searchers and the like, available on WoWInterface and Curse. If it remains maintained, we will even link to it from the wiki.
As an aside, the FAQ on the wiki does link to some deeper information about the statistics and utilities modules; http://Wiki.Norganna.Org/Auctioneer/FAQ and there is an updated "example" coming up in the next release. It is in the Beta/Preview now, if you have any remaining issues; we also welcome questions and such here, too.
Any way, from a quick look, it seems neato. Surely folks who use the UJ will find it of use.
Nerien - I had a look into your module and I have a few comments about the way you are using some of the functions.
GetItemPDF, GetPriceArray, etc. look to all be spot on. Actually, GetPriceArray is only needed for the 'seen' count (and then only because Auctioneer's GetMarketPrice doesn't nil-check properly - I need to look into that some time).
The Processor function is deprecated, replaced by the Processors table. A lot of our modules still have both styles currently (because I haven't got round to tidying them all up yet) but when writing a new module you shouldn't be using Processor at all. Shouldn't be too much trouble to convert as you only process 3 messages (note you've missed "load" out of your Processors table too).
Your OnLoad function will not work 'automatically' because the module name you are using does not match the AddOn name (there are spaces in the module name), but I see that you are using the "load" message to run it instead - note that the "load" message is called for every module, so your OnLoad function will probably be called multiple times.
Actually it's a bit hard to describe everything, may be easier for me to tweak the code myself and post it to you - if you like?
Sadly the wiki appears to be a bit broken at the moment, and I have some reservations about some of the stuff in even the updated Examples files :(
I was trying to follow the Stat-Example module and also using the Stat-Simple module as reference for writing mine. If you have improvements to make it work more properly within Auctioneer, please send me the changes and I'm happy to incorporate them. I just want code to work as well as it can.
I was able to take a look at your proposed changes:
* Moved the sub-sections of lib.Processor into separate lib.Processors functions, and removed lib.Processor
This makes sense and follows Stat-Example, and I've included this change.
* "load" checks the addon name
The load function has a check for (addon == "auc-stat-theunderminejournal"). Where is the string "auc-stat-theunderminejournal" coming from? Is that auto-munged by Auctioneer's main code from libType and libName?
* lib.OnLoad changed to private.OnLoad (lib.OnLoad is used when the module name matches the AddOn name, in which case it would get called automatically by Auctioneer) * Also made it self-deleting so as to only be run once
* private.SetupConfigGui made self-deleting as well * addTooltipControls made local to private.SetupConfigGui, so it will be deleted when private.SetupConfigGui is
I've included these changes.
* Auctioneer's print function renamed to aucPrint, so it doesn't overwrite the Lua print function
As far as I know, overriding Lua's print() is intentional since this exact line of code is in every module I've found for Auctioneer, though that could be because it's from a straight copy-and-paste from Stat-Example. If you know one way or another which is correct, please let me know.
Nerien: "auc-stat-theunderminejournal" is the name of your AddOn, i.e. name of the folder and the .toc file. Auctioneer will send a "load" message for each AddOn that starts with "auc-" & it will always lowercase the name it sends. Since your module is only using this for its own loading purposes, it should check the name and ignore the "load" messages for other AddOns :)
About the lib.OnLoad function, which is the other usual way of doing load operations for a module: Your module name, or libName, is "The Undermine Journal". When Auctioneer sees "auc-stat-theunderminejournal" loading it looks for a Stat module called "theunderminejournal" (case insensitive) - but the difference in spacing causes it to not match. (If it found one, it would look to see if it had a lib.OnLoad, and call it.)
(There's actually a 3rd loading method called "LoadTriggers", but that's for AddOns whose names don't start with "auc-")
The 'print' thing is just cosmetic. I believe historically that WoW Lua didn't have a print function at first, so people made their own. Now that there is one (and I'm used to having it available if I want it!) I tend to rename the Auctioneer version so I know which one I'm using.