pythonluaadd-onworld-of-warcraft

How to extract wow live AH data into python


I want to run some sniping algorithm on WOW Auction house & TSM doesn't provide what I need. I've got my algorithm on python; I need to call a function like this: GetAuctionPrice(Item id , ...) or GetAuctionsPrice(Item id List , ...) After I call, it should somehow communicate with my addon and get the result from it(the Lua code should be waiting for a call somehow). So here are my questions: 1-Is this possible? 2-(if 1=yes)is there any way to do it without spending days learning Lua and coding wow addons(i mean some addon that does this for me)? 3-(if 1=no)is there any alternative implementation to extract data from live game AH? Thanks <3


Solution

  • The largest challenge of your request is that there is no importing of Lua modules and no use of os or file library inside WoW's Lua engine. In other words, there's no native way to write to disk the information you seek. However there are plenty of wow api functions for interacting with the data inside the game (printing it to chat, running calculations, etc).

    For Example (Not Tested):

    local AllAuctions = QueryAuctionItems(nil, nil, nil, nil, nil, nil, true, nil, nil)
    for Index,Item in pairs(AllAuctions) do
      print(GetAuctionItemLink("list", Index)
    end
    

    This is a "GetAll Query" note the following warning from the api:
    (15 minute restriction between getall queries)

    I have not tested this but assuming you wanted to print everything to chat it would look something like the above.