Another fusion of WoW and rails.
While planning Maexyn's conversion to alchemy I thought it would be nice to be able to get a listing of my characters bag and bank items so I could look through my stocks and see what was what. It occurred to me that a nice way to do this would be to scan through the lua files that are dumped by the TBags mod since that holds a database of contents of all my characters bags and bank. Doing this in ruby turned out to be very easy:
-
Install ruby lua support:
sudo aptitude install liblua5.1-0-dev sudo gem install rua
-
Ruby code to convert lua data file into ruby data:
oRua = Rua.new(:all) oRua.eval( open( File.dirname( __FILE__) + "/../../db/TBag.lua").read)
-
oRua now has an array of items that maps onto the data stored in the lua file.
oRua['TBnkItm'] has a list of items in the bank oRua['TInvItm'] has a list of items in the inventory
The end result is this page where I can see what stocks I have. Auctioneer also stores its data in lua so in a similar way I added a lookup so I see the values to these stocks. I can also use the item numbers to add links to the items to thottbot for reference. It isn't perfect, it should show vendor values, especially for soulbound items.
Anyway with this I can plan some sales, particularly of Maexyn's enchanting materials.
Currently the auctioneer data is way out of date, I need to get it running again and do a few scans.
This isn't here as a way of boasting about my vast wealth, I guess a week's karak farming would be better that this junk pile (minions scourgestones?!?).
N.B: an alternative implementation would be simply to write something in the lua language that reads the two lua databases and then dumps out the html. For me it is easier to do it in ruby than learn lua.

