diff --git a/InventoryKamera/scraping/ArtifactScraper.cs b/InventoryKamera/scraping/ArtifactScraper.cs index 883e03c..f66671d 100644 --- a/InventoryKamera/scraping/ArtifactScraper.cs +++ b/InventoryKamera/scraping/ArtifactScraper.cs @@ -133,7 +133,7 @@ public void ScanArtifacts(int count = 0) Navigation.Wait(1); } // Scroll back one to keep it from getting too crazy - if (page % 3 == 0) + if (page % 12 == 0) { Logger.Debug("Scrolled back one"); Navigation.sim.Mouse.VerticalScroll(1); diff --git a/InventoryKamera/scraping/InventoryScraper.cs b/InventoryKamera/scraping/InventoryScraper.cs index d75f1a3..f41213e 100644 --- a/InventoryKamera/scraping/InventoryScraper.cs +++ b/InventoryKamera/scraping/InventoryScraper.cs @@ -386,7 +386,15 @@ internal string CurrentSortingMethod() using (var brush = new SolidBrush(Color.Black)) { // Fill Top region - g.FillRectangle(brush, 0, 0, processedScreenshot.Width, (int)(processedScreenshot.Height * 0.09)); + switch (inventoryPage) + { + case InventoryPage.Artifacts: + g.FillRectangle(brush, 0, 0, processedScreenshot.Width, (int)(processedScreenshot.Height * 0.143)); + break; + default: + g.FillRectangle(brush, 0, 0, processedScreenshot.Width, (int)(processedScreenshot.Height * 0.09)); + break; + } // Fill Left region g.FillRectangle(brush, 0, 0, (int)(processedScreenshot.Width * 0.05), processedScreenshot.Height); @@ -402,11 +410,12 @@ internal string CurrentSortingMethod() List rectangles; int cols, rows, itemCount, counter = 0; double weight = 0; + int itemPerPage = inventoryPage == InventoryPage.Artifacts ? 32 : 40; do { (rectangles, cols, rows) = ProcessScreenshot(processedScreenshot, weight); itemCount = rows * cols; - if (itemCount != 40 && !acceptLess) + if (itemCount != itemPerPage && !acceptLess) { Logger.Warn("Unable to locate full page of weapons with weight {0}", weight); Logger.Warn("Detected {0} rows and {1} columns of items", rows, cols); @@ -425,14 +434,14 @@ internal string CurrentSortingMethod() } else break; - if (itemCount <= 40) + if (itemCount <= 32) weight += 0.125; else { weight -= 0.095; ++counter; } weight = Math.Min(weight, 1); rectangles = null; } - while (itemCount != 40 && weight < 1 && counter < 25); + while (itemCount != itemPerPage && weight < 1 && counter < 25); if (Properties.Settings.Default.LogScreenshots) { @@ -446,7 +455,7 @@ internal string CurrentSortingMethod() if (rectangles == null) { - Logger.Warn("Could not find 40 items in inventory. Re-using previous item page."); + Logger.Warn("Could not find {0} items in inventory. Re-using previous item page.", itemPerPage); return prevRect == null ? throw new ArgumentNullException("Could not find first page of items!") @@ -516,7 +525,7 @@ internal static Bitmap GetLockedBitmap(Bitmap card) { return GenshinProcesor.CopyBitmap(card, new Rectangle( - x: (int)(card.Width * 0.855), + x: (int)(card.Width * 0.75), y: (int)(card.Height * (Navigation.IsNormal ? 0.353 : 0.309)), width: (int)(card.Width * 0.0955), height: (int)(card.Height * (Navigation.IsNormal ? 0.055 : 0.0495))));