Auctioneer/5.0/Modules API
From Norganna's AddOns
Modules in Auctioneer Advanced can be of one of three kinds
- Statistics Modules
- Utility Modules
- Filter Modules
Auctioneer Advanced takes care of loading modules whether they are embedded or not (more on this later). Auctioneer Advanced requires that all modules follow the "Auc-Type-Name" naming convention. Where type is one of "Stats", "Util", or "Filter" depending on the type of module, and Name is chosen by the author. Auctioneer requires that this name be used as both the folder's name and as the internal module name. Some functions will be passed this name as the first argument when called from Auctioneer Advanced, so its individuality is a must.
Auctioneer Advanced also requires that every module add a table of functions to one and only one of the following three locations depending on the type of module that it is. AucAdvanced.Modules.Stats or AucAdvanced.Modules.Util or AucAdvanced.Modules.Filter.
The aforementioned table of functions can include any of the following functions.
All Modules
Passes the addon name.
You can register your interest in being notified of other AddOns than your own by placing an entry for that AddOn's name in your LoadTriggers table.Auctioneer Advanced will call this function whenever it has something to communicate to the module. Example callback types are:
- "auctionui"
Called to inform the module that the auction house has been loaded. - "load", addon
Called whenever an auctioneer advanced module loads. - "tooltip", frame, name, hyperlink, quality, quantity, cost, additional
Called to give the module a chance to display tooltip information. - "listupdate"
Called whenever the auction house browse list is updated. - "config", gui
Called when the GUI config is first opened to give you the chance to add your configuration parameters to it. Supplies the Gui object as the first parameter. - "configchanged", setting, value
Called whenever a parameter is updated in the configuration. Passes the setting name and the new value as parameters. - "inventory"
Fired when there's an inventory change. - "scanstats", stats
A scan has completed and stats are updated. You should clear all your cached stats. Passes statistics about the scan, and what was updated. - "scanprogress", state, totalAuctions, scannedAuctions
Called when the progress of a scan has been changed. The state parameter will be true if we want to show the process indicator, false if we want to hide it and nil if we only want to update it. The totalAuctions parameter will be a number that is the max number of items in the scan and the scannedAuctions parameter is the current progress of the scan. - "pagefinished", pageNumber
Called when AucAdv is done with a page, allowing modules to work with it. - "postresult", success, id, request, [error]
Whenever a queued post has succeeded or failed, this callback will be called. The success flag will be set to either true or false, depending on if the post was made or not. The postId is one of the postIds that was returned in a table from the AucAdvanced.Post.PostAuction(sig, size, bid, buyout, duration, multiple) function. The request parameter contains the detail of the post in a table like: {sig, size, bid, buyout, duration}. The error message is passed if there was an error and contains the text of the error. - "bidplaced", auctionstring
Called whenever a bid has been successfully placed. Auctionstring is "itemlink;seller;count;buyout;pricepaid;reason"
If you want to store stats about the items as they are scanned, you should place entries in this table with the key equal to one of the below message types and pointers to the function that you want to process that data as the values. The possible messages that can be sent to your module are:
- "begin"
Sent when the scanner is about to send a batch of data. Initializing once-per-scan variables here is a good idea instead of redoing them for every single item. - "update", newitem, olditem
An existing item has been changed. - "leave", olditem
An existing item that still exists and has not changed. - "create", newitem
A new item has been found which did not exist prior to the scan. - "delete", olditem
An item that existed prior to the scan now does not exist. - "complete"
The batch has completed, you may now cleanup / process / store any accumulated data.
Whenever an AddOn loads that has a key in this table, your OnLoad(addon) function will be called with that AddOn's name.
Note: All AddOn's names should be entered into this table in lowercaseStatistics Modules
Statistics modules collect and create statistic data, and their statistic data is used to provide market pricing data via the API function AucAdvanced.API.GetMarketValue(itemLink, serverKey).
Three of the keys that are expected to be in this table are "price", "seen", and "confidence", being the best price, the seen count, and a confidence value (0.00-1.00).
Other values may be provided by the AddOn in other fields.
Utilities Modules
Utilities modules are no less flexible than statistics modules and may provide whatever functions they need to provide, even to the extent of providing pricing functions like the above statistics modules. Prices provided by a Utility module will not be used for the market value supplied by the AucAdvanced.API.GetMarketValue(itemLink, serverKey) function. If it does provides pricing function, it will however appear in the list generated by AucAdvanced.API.GetAlgorithms() and be queryable via the AucAdvanced.API.GetAlgorithmValue(algorithm, itemLink, serverKey) function. It may be a good idea to place derivative statistics or abstract statistics functions in as utilities in order to avoid polluting the market value data with crazy prices. Generally utility modules will have a more interactive nature than statistics modules, providing UI functionality and/or abstract (non-price related) statistical data.

