Thread Tools Display Modes
07-30-11, 09:29 AM   #1
Bleckpan
A Fallenroot Satyr
 
Bleckpan's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 22
AH Query Results

I am trying to create an add-on that will grab all the glyph prices off of the AH. However, when I call
Code:
QueryAuctionItems("Glyph", nil, nil, nil, 5, nil, nil, false, nil, true)
and put that data into tables with
Code:
numBatchAuctions, totalAuctions = GetNumAuctionItems("list")
Glyph_Count = totalAuctions
for Glyph_Number = 1, Glyph_Count do
local name, _, count, _, _, _, minBid, _, buyoutPrice, _, _, _, _ = GetAuctionItemInfo("list", Glyph_Number) 
-- if string.find (name, "Glyph") == nil then return end
Glyph_List_Names [Glyph_Number] = name
Glyph_List_Count [Glyph_Number] = count
Glyph_List_MinBid [Glyph_Number] = minBid
Glyph_List_MinBO [Glyph_Number] = buyoutPrice
I end up with tables of all 18 thousand auctions on the auction house. Using string.find as a workaround will result in having four empty tables. Does the fault lie in querying or saving?
Here is my full code:http://pastebin.com/qB6vydkV.
Thanks in advance!

Last edited by Bleckpan : 07-30-11 at 09:30 AM. Reason: Fixed fail wording.
  Reply With Quote
07-30-11, 02:31 PM   #2
lilsparky
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 117
that last "true" in your query is the "getall" flag. if you set that to true, it gets every item at the auction house.
  Reply With Quote
07-30-11, 03:32 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Code:
if string.find (name, "Glyph") == nil then return end
This kill kick out of the function if the first auction item isn't a glyph and ignore everything else.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
07-30-11, 09:55 PM   #4
Bleckpan
A Fallenroot Satyr
 
Bleckpan's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 22
After messing around with going through each page, I decided using http://pastebin.com/nBXFi5av may be easier/quicker. But of course not!

After querying the auction house, my client decides to "freeze" up. My cursor still responds when when I move my mouse, but the UI does not respond to anything. After about 15 min, I get the "disconnected from server" popup.

Is this a result of using too much memory? It hits about 78 MB before it freezes up. Is there a more efficient way of putting data into tables than this?
Code:
for Item_Number = 1, wholeCount do
 name, _, _, _, _, _, _, _, buyoutPrice, _, _, _, _ = GetAuctionItemInfo("list", Item_Number) 
  if string.find(name, "Glyph") == 1 then
  Glyph_List[Glyph_Count] = {name, buyoutPrice}
  Glyph_Count = Glyph_Count + 1
  end
 end
  Reply With Quote
07-30-11, 10:22 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
What's happening is your code is going in its loop through 18k entries. This doesn't happen instantly, it takes a lot of processing. While the loop is running, Wow can't do anything, even communicate with the server. What many scanners do is hook their processing code with the OnUpdate handler of a frame and scan through a limited number of entries per frame, then let WoW do what it needs to do before continuing.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » AH Query Results


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off