Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Min value from list AuctionItem

Featured Replies

 

Hi, I need help, I tried to get the minimum value from Auction Page

List<AuctionHelpers.AuctionItem> auklist = new List<AuctionHelpers.AuctionItem>();
                      foreach (var item in AuctionHelpers.GetBrowsePageItems())
                    {
                        if(item.IsValid())
                        auklist.Add(item);                       
                    }
  var ChepestItemauklist = auklist.Where(x => x.Name == "Frostweave Bag").OrderBy(x => x.BuyoutPricePerUnit).Min();//error code

but I get an error if I try to use such code

image.png.fbdfd22edd10eee1aa74cffd311889f0.png

 

I need to know the minimum price on the page to use it for comparison.

 

Does anyone know which method to use to get the minimum buyout price from the AuctionItem array?

 

I know what you can extract into a separate BuyoutPrice list<int> and then everything seems to work as it should, but I would like to know if you can get the minimum value from multidimensional arrays of the wrobot?

5 Jun 2020 05H15.log.html

Hi. Try this. Returns a dictionary where key is itemname and value is lowest price.

    private static Dictionary<string, int> GetLowestItemPrice()
    {
        Dictionary<string, int> CheapestItems = new Dictionary<string, int>();        
        List<AuctionHelpers.AuctionItem> ItemsList = new List<AuctionHelpers.AuctionItem>();
        List<string> ItemsToCheck = /*your list of items*/
        int LowestPrice = 0;

        if (AuctionHelpers.AuctionHouseIsShown()) 
            foreach (string item in ItemsToCheck)
            {                
                AuctionHelpers.BrowseNameSetText(item);
                Thread.Sleep(2000);
                AuctionHelpers.IsUsableCheckButtonSetChecked(false);
                if (AuctionHelpers.BrowseSearchButtonIsEnabled())
                {                
                    AuctionHelpers.BrowseSearchButtonClick();
                    Thread.Sleep(2000);
                    while (AuctionHelpers.BrowseNextPageButtonIsEnabled())
                    {
                        if (AuctionHelpers.GetBrowsePageItems().Any())
                        {
                            ItemsList.AddRange(AuctionHelpers.GetBrowsePageItems());                            
                            AuctionHelpers.BrowseNextPageButtonClick();
                            Thread.Sleep(1000);
                        }
                    }
                    if (AuctionHelpers.GetBrowsePageItems().Any())
                        ItemsList.AddRange(AuctionHelpers.GetBrowsePageItems());
                    ItemsList.RemoveAll(i => (i.Name != item) || (i.BuyoutPricePerUnit == 0));
                    LowestPrice = ItemsList.Min(price => price.BuyoutPricePerUnit);
                    CheapestItems.Add(item, LowestPrice);
                }                               
            }       
        
        foreach (KeyValuePair<string, int> kvp in CheapestItems)
        {            
            Logging.Write("Itemname = " + kvp.Key + "Itemprice " + kvp.Value);
        }
        AuctionHelpers.CloseAuctionHouse();
        return CheapestItems;
    }

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.