+ Reply to Thread
Results 1 to 5 of 5

Thread: Problems with Command.Auction.Analyze

  1. #1
    Plane Touched
    Join Date
    Jan 2011

    Default Problems with Command.Auction.Analyze

    I've got a simple auction data-dumper that grabs auction data for a pre-defined set of materials and crafted items (Thalasite Ore; Opaque Rune Amender; Spongy Insoles; etc.). Up until the introduction of Planar Crafting, I've had no problems. Now, I'm trying to get data for some of the Planar crafted items, and I keep getting errors for those items, and only those. Possibly related to this problem is that these are the first directly equip-able items I've tried to include in this process; all my previously analyzed items have been consumables/enchants/amenders/etc.

    What I'm doing is using:
    Command.Event.Attach(Event.Auction.Statistics, function(handle, itemtype, data)  print(itemtype) dump(data) end, "TomAD")
    and then recursively making an Analyze call for each item, e.g.:
    Command.Auction.Analyze("IFE4A8718B11CCD4C,B1E75C3FA31C13F4,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Lanzan Cloth
    Command.Auction.Analyze("I5C2F735A22D84531,1A061B2644CD76F6,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Congealed Dreams
    Command.Auction.Analyze("IFE6FF2F4BF4811C8,23811A8A2F4BE4F4,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Nightmare Touched Bag
    This fails when I try this with one of the new Planar Crafted items:
    Command.Auction.Analyze("IFC372CF96F529D52,26D86FDBCC69AFCD,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Arcanist's Blazing Sash
    Command.Auction.Analyze("IFC372CFB079286C0,1E3E26ACB619CD53,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Arcanist's Blazing Cowl
    Command.Auction.Analyze("IFC372CFA549A4B54,3D9F11483D62C0C4,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Arcanist's Blazing Robe
    Command.Auction.Analyze("IFC372D0168D1D64D,E1BC454C94633CCD,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Blackguard's Tidal Harness
    Command.Auction.Analyze("IFC372D0279425556,2A2F75356D786095,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Blackguard's Tidal Tunic
    Command.Auction.Analyze("IFC372D030F1499C6,2E50DF55910089EA,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server() ) --Blackguard's Tidal Hood
    What's really weird is these calls work fine in the console, with a "/script" prefix.

    Anyone got any ideas what I might be doing wrong?

    (BTW: you need to have the AH open for any of these calls to work)

  2. #2
    General of Telara
    Join Date
    Mar 2014


    Would help if you tell us what error you actually get...

    I don't see where you do anything "recursively" (and you probably don't want to do that anyway), but my suspicion would be that you ignore the throttling of such commands:
    This command is throttled by the "auctionanalyze" throttle type, proportional to the number of days requested.
    At some point the command queue will be full if you don't wait with sending new commands until you receive the result, and it will fail one way or the other.

  3. #3
    Plane Touched
    Join Date
    Jan 2011

    Default Error details

    Good points.

    I'm actually calling about 30 of the individual Command.Auction.Analyze commands in each version of my invocation of my add-on (I'm up to 5). Much more than that and I seem to get time-outs. That's not the problem with the Planar Crafting items, though. They errored out with just a few calls.

    Here's the error details:

    Error: Incorrect function usage.
    Parameters: "IFC372CF96F529D52,26D86FDBCC69AFCD,,,,,,", 1438137976, 1439347576
    Parameter types: string, number, number
    Function documentation:
    Requests auction statistics from the server. The results will be sent to Event.Auction.Statistics. This command is throttled by the "auctionanalyze" throttle type, proportional to the number of days requested.
    Requires the "auction" interaction flag to be set.
    Command.Auction.Analyze(itemtype, begin, end) -- itemtype, number, number
    Command.Auction.Analyze(itemtype, begin, end, callback) -- itemtype, number, number, callbackfunction
    begin: UNIX timestamp to begin analysis at.
    callback: A standard command callback, used for detecting success or failure. See the "callbackfunction" documentation for more details.
    end: UNIX timestamp to end analysis at.
    itemtype: Item type to analyze.
    In TomAuctionDumper / TomAD, event Event.Slash.tomad5
    stack traceback:
    [C]: ?
    [C]: in function 'Analyze'
    TomAuctionDumper/main.lua:150: in function <TomAuctionDumper/main.lua:147>

    As you can see, it fails on the first call from the snippet in the last CODE segment of the original post
    Last edited by xeroid; 08-11-2015 at 06:52 PM.

  4. #4
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011


    Can you maybe wrap it in a pcall, so at least when/if it bombs it doesnt take everything with it?

    Catch the failure, and then retry again a bit later? I wonder if this works the same as Inspect.Item.Detail() - where it may take a few tries seperated by time for the item to work?

    local st, res = pcall(Command.Auction.Analyze, "IFC372CF96F529D52,26D86FDBCC69AFCD,,,,,,", Inspect.Time.Server()-1209600, Inspect.Time.Server())
    if st then
    	print ("C.A.A success")
    	print ("C.A.A failure")
    	-- keep the item ID around and try again later
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  5. #5
    General of Telara
    Join Date
    Mar 2014


    Honestly, that sounds all very hacky. You shouldn't assume that you can stuff "x" commands into a queue for an asynchronous command when the documentation doesn't even mention whether there is such a queue.

    We don't know how it is implemented, who knows, the equivalent of Inspect.Item.Detail() may indeed be required internally to execute an Analyze command, and those are both throttled and locally cached themselves.

    I just noticed there is an optional fourth parameter "callback", quite possible that if you provide that it will actually tell you why it failed, rather than throwing an "incorrect function usage" Lua error. From the API Docs:

    A callback function, used to signal success or failure. Must be a function that takes two parameters, "failure" and "message". On success, "failure" will be false or nil. Otherwise, "failure" will be either a computer-readable string identifier or true. "message" may contain a human-readable message that may be delivered to the user.
    Anyway, in my opinion the proper implementation would be to send one (not two, three or even thirty) Analyze command and wait until you receive the result by Event.Auction.Statistics, and then send the next one.
    You could for example do that by wrapping the query function in a coroutine, add coroutine.yield() commands between each Command.Auction.Analyze(), and put a coroutine.resume() at the end of your Event.Auction.Statistics handler.

+ Reply to Thread


Posting Permissions

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