• Visit Honorbuddy
  • Visit Rebornbuddy
  • Visit Demonbuddy
  • Visit Exilebuddy
  • Visit Hearthbuddy
  • Visit Pokefarmer
  • Visit Buddystore

How can I make an auction listing? Having problem using MakeAuctionLot

Discussion in 'Community Developer Forum' started by Voyager92, Jan 7, 2017.

  1. Voyager92

    Voyager92 New Member

    Joined:
    Nov 3, 2014
    Messages:
    287
    Likes Received:
    1
    Trophy Points:
    0
    Good evening guys,

    Can someone plz post a snippet on how to create an auction for a specific product with a certain amount? For example, I want to create an auction for 500 Barley with a Buyout of 3s per item and the Starting Bid of 10g. I searched a lot in the forums in the API and could not make it work.

    The best idea I could find was that I needed to create an stack of 500 barley and do a MakeAuctionLot, but had problems doing that, since C# isn't my main programming language, I appreciate if someone could let me a hand, thx.
     
  2. Out

    Out New Member Buddy Core Dev Buddy Store Developer

    Joined:
    Jun 2, 2012
    Messages:
    2,974
    Likes Received:
    12
    Trophy Points:
    0
    Code:
    //or getInvItems(ITEM_ID)
    var item = getInvItem("Barley");
    if (item != null)
    {
        //1 silver = 100 copper
        //baseSellPrice - starting price for one item
        //buyBackPrice - buyback price for one item.
        item.MakeAuctionLot(300 /*baseSellPrice*/, 500/*buyBackPrice*/, AuctionSellTime.TwentyFourHours);
        //this will put stack of item to auction.
        //if you need to put two or more stacks or find stack that you need - you can use something like    
        foreach (var item in getInvItems("Barley"))
        {
             if (item..... ......)
                    ...........
        }
    }
    
     
  3. Voyager92

    Voyager92 New Member

    Joined:
    Nov 3, 2014
    Messages:
    287
    Likes Received:
    1
    Trophy Points:
    0
    Big thx for the help Out, but I was wondering, is it possible to sell stacks of 200 for example of a given item?
     
    Last edited: Jan 8, 2017
  4. Out

    Out New Member Buddy Core Dev Buddy Store Developer

    Joined:
    Jun 2, 2012
    Messages:
    2,974
    Likes Received:
    12
    Trophy Points:
    0
    Split them first into stacks with needed count
     
  5. Voyager92

    Voyager92 New Member

    Joined:
    Nov 3, 2014
    Messages:
    287
    Likes Received:
    1
    Trophy Points:
    0
    Yeah, when I tried the plugin yesterday, it worked with the stacks, thanks for the help Out.
     

Share This Page