Add an Auctipus plug-in
empiricalbw opened this issue ยท 11 comments
Hi! It sounds like adding a plug-in for Auctipus support should be pretty easy. Auctipus tracks the range of lowest buyout for each item it scans on a daily basis. I.e. if you scan the AH more than once and someone bought out the very cheapest auction between scans, then you'll see a range consisting of the cheapest auctions observed during each scan.
It sounds like I need to add a function to return a price given an item ID. I would think I would return the highest end of the most recent range instead of the lowest end. On the other hand, if the AH hasn't been scanned in 4 days, should I maybe return nil instead since the prices could be much different now? Or is it better to do a statistical analysis and find an average over the last 2-4 weeks or something?
Can't you disable the other AH addons for the test? Or is Skillet actually trying to get data from them all simultaneously and display it from each source? That would be cool!
My internet is flaking out today so I don't know if I will be able to make any progress on this until tomorrow.
Skillet-Classic uses the data provided by the AH plugins to compare the value of the item created by a recipe with the sum of the values of the reagents (that are not provided by vendors). The difference is the profit (or loss) potential for each recipe.
The most sophisticated plugin is probably the Auctionator plugin. In addition to the basic functions, it has a shopping list API so that Skillet-Classic can ask for the prices of all the items in its own shopping list or it can ask for the prices for a specific recipe's reagents.
The AuctionLite plugin is an example of simple implementation.
I'd start with a simple function. If you want to add an optional input like lowest or highest, it can easily be implemented in the plugin.
I can help with the Skillet-Classic side if you want.
I'm just taking a look at the AuctionLite plugin example. It seems to implement a method:
auctionData = AuctionLite:GetAuctionValue(itemID)
However, it seems like itemId can also be a link since later on we have:
reagentData = AuctionLite:GetAuctionValue(reagentLink)
where reagentLink looks like it might sometimes be a link or a stringified item ID.
On the other hand, it looks like the Auctionator plugin is just using plain item IDs so maybe this is flexible and just matters in the plugin code and not actually a Skillet-Classic requirement?
One thing about Auctipus is that it maintains separate data for enchanted vs. non-enchanted items, so any given itemID could appear multiple times in the Auctipus database (the database is actually keyed by the auction's itemLink which includes enchant info rather than simply by itemID). Will Skillet be looking for prices of enchantable items or is it just looking for reagents - i.e. do I have to handle the case where Auctipus may have multiple matches for a given item ID? Finally, since I don't have a database keyed by itemID, doing a lookup is O(N) since it has to scan each item. This is typically pretty fast (the same thing happens on the fly in the Auctipus "Scans" page when you are typing into the search bar and there is no noticeable delay) but if Skillet is going to perform lots of queries then I should probably set up an itemID index as well. That would take up a chunk of memory though, which is why I ask instead of just doing it! :P
Anyways, the branch skillet_support in the Auctipus repo has a new function that can be used by other addons:
Auctipus.API.GetAuctionBuyoutRange(itemId)
This returns the observed range of the cheapest buyout (the cheapest auction can fluctuate over the course of a day) and how many days have elapsed since the item was observed for auction.
https://github.com/empiricalbw/Auctipus/tree/skillet_support
The Skillet-Classic plugins were submitted to me by others like yourself, I didn't write them. I do maintain them to the extent that if the Skillet-Classic interface changes (or is enhanced), I take care of that. Until you mentioned it, I never noticed that the AuctionLite plugin uses both!
So to answer your question, Skillet-Classic can call your function with either an itemID or an itemLink (and whatever additional parameters you wish). Since these are either items that the user can make or the reagents necessary to make that item, enchants will never be involved.
Given that a typical profession at level 70 has around 300 recipes with around 30 or so displayed at any one time, Skillet-Classic will call this function 30 times for each item and 30 times the number of reagents each time the profession is opened.
If it is easier for you, the call can always use itemLink.
Here is a first pass at the plugin. Let me know if you see any issues or have any comments. It goes in the Skillet-Classic\Plugins directory and the .toc needs a line added to include it. I'll get an alpha built after some preliminary testing.
Auctipus.zip (actually second pass!)
Because of this issue, it is difficult to determine if the data being returned is accurate.
I have disabled all my other AH addons to test but if I want to verify that Auctipus is returning reasonable data, I need to enable one of the other AH addons so I can compare.
Yes, Skillet-Classic is simultaneously querying all the enabled AH addons that have an API that allows them to return data even when the AH is not open.
So I looked at Auctionator and this is what is happening:
- Auctipus prevents the Blizzard Auction UI from loading since it replaces it rather than augments it.
- Auctionator has an OnLoad handler that registers for handling many events, including AUCTION_HOUSE_SHOW.
- Normally, Auctionator waits for the Blizzard Auction UI to load and then augments that UI with its own frames, in this case by creating an Atr_Sell_Template frame named Atr_Main_Panel. However, since Auctipus prevents the Blizzard Auction UI from ever loading, this main panel frame never gets created.
- Later, the player clicks on an auction master which triggers AUCTION_HOUSE_SHOW. Auctionator attempts to modify a dropdown field that appears in Atr_Main_Panel here, even though that frame was never instantiated. Lua error ensues.
I don't see any easy way for me to fix that. Auctionator shouldn't be registering for all those events or trying to access its frames if they don't exist.
Which other auction addons do you test with? I can take a look at them tomorrow to see if there's anything easy to do to get them working.
The other big one is Auctioneer.
Skillet-Classic has a plugin for AuctionDB.
There are a couple others like AuctionFaster, AuctionBuddy, and AuctionMaster which are mostly up to date.
I think the Skillet-Classic AuctionLite plugin may be obsolete.
Skillet-Classic "replaces" the Blizzard TradeSkill (and Craft) UI but it does so by "hiding" those frames. Shift-clicking on a profession button will temporarily use the Blizzard UI instead of the Skillet-Classic UI. This allows addons which interact with the Blizzard UI to not get errors, but the user won't see them unless they explicitly ask for them. Skillet-Classic even has an option that allows the Blizzard UI to stay on the screen along with the Skillet-Classic UI which I added mostly for debugging purposes.
Like I've said before, I don't think Auctipus needs to co-exist with these other addons, but if it displayed a warning that those other addons are incompatible, then the user won't be surprised when the other addons generate errors like Auctionator does.
BTW, Skillet-Classic can only co-exist with TradeSkillMaster if TSM is configured a certain way. Skillet-Classic checks for that and notifies the user that TSM isn't configured for Skillet-Classic compatibility.
Skillet-Classic-1.34-alpha5 has an updated plugin (and fixes to other plugins).