+ Reply to Thread
Results 1 to 10 of 10

  Click here to go to the first Rift Team post in this thread.   Thread: Incorrect function usage Command.Auction.Scan(params)

  1. #1
    Rift Disciple
    Join Date
    Mar 2011
    Posts
    130

    Default Incorrect function usage Command.Auction.Scan(params)

    To put it simply, I'm trying to access the Command.Auction.Scan function, but I can't seem to nail it down.

    Here's the latest implementation I used (which leads to a "Incorrect function usage")

    Code:
    scan_params = {_,_,_,_,_,_,_,"seller","ascending",_,"search"}
    ah_content = Command.Auction.Scan(scan_params)
    can anyone tell me what is incorrect in that ?

    Thanks !

  2.   Click here to go to the next Rift Team post in this thread.   #2
    Rift Team
    Join Date
    Oct 2010
    Posts
    927

    Default

    Quote Originally Posted by Frostshizzle View Post
    To put it simply, I'm trying to access the Command.Auction.Scan function, but I can't seem to nail it down.

    Here's the latest implementation I used (which leads to a "Incorrect function usage")

    Code:
    scan_params = {_,_,_,_,_,_,_,"seller","ascending",_,"search"}
    ah_content = Command.Auction.Scan(scan_params)
    can anyone tell me what is incorrect in that ?

    Thanks !
    Command.Auction.Scan() expects a key-value table, looking something like {levelMin = 20, levelMax = 40, sort = "name"}.

    One good way to get Scan parameters: Install Trion Development Tools, type "/eventlog Auction.Scan", go to the auction house, do searches. The first parameter is in the same format as what Command.Auction.Scan expects.

  3. #3
    Rift Disciple
    Join Date
    Mar 2011
    Posts
    130

    Default

    Thanks, I nailed this part now.

    If I might ask, how to I assign the returned values to a table? I thought the "Event.Auction.Scan" would return it, but what I got was rather a list of active add-ons as well as a list of functions instead of the actual "data" (I was expecting the IDs).

    Here's the code I used.

    Thanks again

    Code:
    local function process_ah_data(scan_params)
    	-- this is where the data should be processed
    	if Event.Auction.Scan then
    		-- details requires the list of IDs in order to work
    		details = Inspect.Auction.Detail()
    		table.foreach(details, print)
    	end
    end
    
    
    local function scan_ah()
    	-- check for interaction with the AH window
    	local status = Inspect.Interaction("auction")
    	if status == true then
    		-- check if the full scan queue is ready
    		full_scan_is_ready = Inspect.Queue.Status("auctionfullscan")
    		if full_scan_is_ready == true then
    			-- determine the type of search
    			scan_params = {type="search"}
    			-- execute the scan
    			Command.Auction.Scan(scan_params)
    			-- call for processing the data
    			process_ah_data(scan_params)
    		else
    			print("Auction full scan isn't ready yet")
    		end
    	else
    		print("You need to open the auction house window first")
    	end
    end

  4. #4
    Rift Disciple
    Join Date
    Mar 2011
    Posts
    130

    Default

    another question, related to the Inspect.Queue.Status("auctionfullscan")

    Are ALL Command.Auction.Scan(params), without indexes are considered "fullauctions" scan even when a search is applied ?

    If so, that makes the process of looking for a specific item prior to posing it counter-productive as it takes your "fullauctionscan" slot.

  5.   This is the last Rift Team post in this thread.   #5
    Rift Team
    Join Date
    Oct 2010
    Posts
    927

    Default

    Quote Originally Posted by Frostshizzle View Post
    Thanks, I nailed this part now.

    If I might ask, how to I assign the returned values to a table? I thought the "Event.Auction.Scan" would return it, but what I got was rather a list of active add-ons as well as a list of functions instead of the actual "data" (I was expecting the IDs).
    You'll need to actually process the Event.Auction.Scan event - the list of IDs is one of the parameters. Check the example addons for demos on how to do that.


    Quote Originally Posted by Frostshizzle View Post
    Are ALL Command.Auction.Scan(params), without indexes are considered "fullauctions" scan even when a search is applied ?

    If so, that makes the process of looking for a specific item prior to posing it counter-productive as it takes your "fullauctionscan" slot.
    Yes, they are. Either add an index (you can, at the very least, get the first 50 items this way), or do a single full scan before posting and then refer to that while posting.

  6. #6
    Rift Disciple
    Join Date
    Mar 2011
    Posts
    130

    Default

    Quote Originally Posted by ZorbaTHut View Post
    You'll need to actually process the Event.Auction.Scan event - the list of IDs is one of the parameters. Check the example addons for demos on how to do that.
    There is definitely something I didn't get here.

    I've added the following "eventlog" => Auction.Scan so, when I execute a Command.Auction.Scan, I see the actual output of Event.Auction.Scan printed on the screen. And yet, the following code :

    Code:
    local function process_ah_data(scan_params)
    
    	scan_info = Event.Auction.Scan
    	print("scan_info:")
    	for key, value in pairs(scan_info) do
    	table.foreach(value, print)
    	end
    end
    Yields the following results :

    Code:
    scan_info:
       1 function 0x073a72cfcf0
       2 TrionDevelopmentTools
       3 Event.Auction.Scan hook
       1 function 0x073a72d0
       2 aher => this is my addon
       3 Process AH data  This is my handler
    Wht am I doing wrong ?

  7. #7
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    If it functions like any other event, then something like

    function AHResults(r)
    for k,v in pairs(r) do
    dump(k,v)
    end

    table.insert(Event.Auction.Scan, { AHResults, "AHR", "AHResults" } )

    As it stands, you are assigning the event itself to your variable, and then printing out all the things that it is made up of, rather than catching the event and processing the results.

    I've not looked at any of this, so could be way off, so take with a grain of salt!
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  8. #8
    Rift Disciple
    Join Date
    Mar 2011
    Posts
    130

    Default

    Quote Originally Posted by Adelea View Post
    If it functions like any other event, then something like

    function AHResults(r)
    for k,v in pairs(r) do
    dump(k,v)
    end

    table.insert(Event.Auction.Scan, { AHResults, "AHR", "AHResults" } )

    As it stands, you are assigning the event itself to your variable, and then printing out all the things that it is made up of, rather than catching the event and processing the results.

    I've not looked at any of this, so could be way off, so take with a grain of salt!
    I'll look this up, a big thanks!

  9. #9
    Rift Disciple
    Join Date
    Mar 2011
    Posts
    130

    Default

    looks like this added a new table to the "Event.Auction.Scan" => AHResults

    I haven't been able to see its content, the PTS went down before I could, hopefully, this will be what I need

  10. #10
    Shadowlander
    Join Date
    Aug 2013
    Posts
    32

    Default

    Is anyone able to post a complete and working example of what Frostshizzle wanted to achieve? I am trying to understand how Command.Auction.Scan is tied to Event.Auction.Scan, how to acutally retrieve results from auction scan and either print it to console or bind to some kind of grid.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts