Not signed in (Sign In)
  1.  
    [pre]function getItemSignature(sigData)
        if (not sigData) then return nil end
        for id,rprop,enchant,name,count,min,buyout,uniq in string.gfind(sigData, "(%d+):(%d+):(%d+):(.-):(%d+):(.-):(%d+):(.+)") do
            if (name == nil) then name = ""; end
            return tonumber(id),tonumber(rprop),tonumber(enchant),name,tonumber(count),tonumber(min),tonumber(buyout),tonumber(uniq);
        end
        return nil;
    end
    [/pre]

    is the 'min' value being returned, the minimum bid? if not, where do i get that from?
  2.  
    Posted by: xenoputtss on Feb 6 2006, 04:41 PM
    [pre]function getItemSignature(sigData)
        if (not sigData) then return nil end
        for id,rprop,enchant,name,count,min,buyout,uniq in string.gfind(sigData, "(%d+):(%d+):(%d+):(.-):(%d+):(.-):(%d+):(.+)") do
            if (name == nil) then name = ""; end
            return tonumber(id),tonumber(rprop),tonumber(enchant),name,tonumber(count),tonumber(min),tonumber(buyout),tonumber(uniq);
        end
        return nil;
    end
    [/pre]

    is the 'min' value being returned, the minimum bid? if not, where do i get that from?

    Yes, its the starting bid, which is different from the current bid.
  3.  
    ok, one more question I have this code that I modifed to make a new search function.

    [pre]
    function venTrashFilter(sType, signature)
        --sType will be to toggel between bids and buyouts
        local id,rprop,enchant, name, count,min,buyout,uniq = Auctioneer.Core.GetItemSignature(signature);
        local itemKey = id..":"..rprop..":"..enchant;

        local auctKey = Auctioneer.Util.GetAuctionKey();
        local itemCat = Auctioneer.Util.GetCatForSig(signature);
        local snap = Auctioneer.Core.GetSnapshot(auctKey, itemCat, signature);
        if not (buyout > 0) then
            buyout = 0
        end
        local ret;
        if (Informant) then
                ret = Auctioneer.API.GetVendorBuyPrice(id)
        end
        if (    (
                (buyout > 0)
                and buyout < ret
            ) or
            (
                buyout == 0  
                and min < ret
            )
        ) then
            return false;
        end
        return true;
    end
    [/pre]

    my problem is that
    Auctioneer.API.GetVendorBuyPrice(id) needs an itemID, but I don't think i have one at this point. Is there a way i can get an itemID from 'signature'?
  4.  
    Posted by: xenoputtss on Feb 6 2006, 10:23 PM
    ok, one more question I have this code that I modifed to make a new search function.

    [pre]
    function venTrashFilter(sType, signature)
        --sType will be to toggel between bids and buyouts
        local id,rprop,enchant, name, count,min,buyout,uniq = Auctioneer.Core.GetItemSignature(signature);
        local itemKey = id..":"..rprop..":"..enchant;

        local auctKey = Auctioneer.Util.GetAuctionKey();
        local itemCat = Auctioneer.Util.GetCatForSig(signature);
        local snap = Auctioneer.Core.GetSnapshot(auctKey, itemCat, signature);
        if not (buyout > 0) then
            buyout = 0
        end
        local ret;
        if (Informant) then
                ret = Auctioneer.API.GetVendorBuyPrice(id)
        end
        if (    (
                (buyout > 0)
                and buyout < ret
            ) or
            (
                buyout == 0  
                and min < ret
            )
        ) then
            return false;
        end
        return true;
    end
    [/pre]

    my problem is that
    Auctioneer.API.GetVendorBuyPrice(id) needs an itemID, but I don't think i have one at this point. Is there a way i can get an itemID from 'signature'?

    Two things:
    1. "id" contains the item's ItemID, however Informant requires ItemID to be a number, not a string. so you have to do the following:
      [pre]ret = Auctioneer.API.GetVendorBuyPrice(tonumber(id))[/pre]
    2. The second thing is that Auctioneer already checks if Informant is loaded/available so your own "if(Informant) then" is not required. However if Informant is not loaded then you'll get nil errors when you try to compare it with buyout and min. So you need to do something like:
      [pre]buyout = buyout or 0;
      local ret = Auctioneer.API.GetVendorBuyPrice(tonumber(id)) or 0;
      if (    (
              (buyout > 0)
              and buyout < ret
          ) or
          (
              buyout == 0  
              and min < ret
          )
      ) then
          return false;
      end
      [/pre]
  5.  
    Posted by: MentalPower on Feb 7 2006, 11:53 AM
    [*]"id" contains the item's ItemID, however Informant requires ItemID to be a number, not a string. so you have to do the following:
    [pre]ret = Auctioneer.API.GetVendorBuyPrice(tonumber(id))[/pre]


    shwing! I can't believe that I didn't even think that id was a string. I thought it was the itemID, but .. . .well, you see that I didn't realize it was a string of the number.

    Thanks for you help.
  6.  
    Posted by: xenoputtss on Feb 7 2006, 01:40 PM
    shwing! I can't believe that I didn't even think that id was a string. I thought it was the itemID, but .. . .well, you see that I didn't realize it was a string of the number.

    Thanks for you help.

    No problem, anytime.
World of Warcraft™ and Blizzard Entertainment™ are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.