inventory snapshot addition

This commit is contained in:
Boki 2026-02-24 12:37:08 -05:00
parent db3069660e
commit 53641fc8e7
7 changed files with 18 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 MiB

After

Width:  |  Height:  |  Size: 7 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 MiB

After

Width:  |  Height:  |  Size: 6 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 319 KiB

Before After
Before After

View file

@ -130,7 +130,7 @@ public class KulemakExecutor : MappingExecutor
await Sleep(Delays.PostStashOpen);
// Scan inventory now that stash (and inventory panel) is open
var scanResult = await _screen.Grid.Scan("inventory");
var scanResult = await _inventory.SnapshotInventory();
if (scanResult.Occupied.Count > 0)
{
@ -467,7 +467,7 @@ public class KulemakExecutor : MappingExecutor
for (var pass = 0; pass < 3; pass++)
{
var scanResult = await _screen.Grid.Scan("inventory");
var scanResult = await _inventory.SnapshotInventory();
if (scanResult.Items.Count == 0)
{
if (pass > 0) Log.Information("Inventory clear after {Pass} passes", pass);

View file

@ -607,7 +607,7 @@ public abstract class MappingExecutor : GameExecutor
for (var pass = 0; pass < 3; pass++)
{
var scanResult = await _screen.Grid.Scan("inventory");
var scanResult = await _inventory.SnapshotInventory();
if (scanResult.Items.Count == 0)
{
if (pass > 0) Log.Information("Inventory clear after {Pass} passes", pass);

View file

@ -1,4 +1,5 @@
using Poe2Trade.Core;
using Poe2Trade.Screen;
namespace Poe2Trade.Inventory;
@ -11,6 +12,7 @@ public interface IInventoryManager
string SellerAccount { get; }
void SetLocation(bool atHome, string? seller = null);
Task ScanInventory(PostAction defaultAction = PostAction.Stash);
Task<ScanResult> SnapshotInventory();
Task ClearToStash();
Task<bool> EnsureAtOwnHideout();
Task ProcessInventory();

View file

@ -48,6 +48,9 @@ public class InventoryManager : IInventoryManager
await Helpers.Sleep(Delays.PostFocus);
await _game.OpenInventory();
_game.MoveMouseInstant(1700, 700);
await Helpers.Sleep(100);
var result = await _screen.Grid.Scan("inventory");
LastScreenshot = await _screen.CaptureRegion(GridLayouts.Inventory.Region);
@ -64,6 +67,16 @@ public class InventoryManager : IInventoryManager
await Helpers.Sleep(Delays.PostFocus);
}
public async Task<ScanResult> SnapshotInventory()
{
_game.MoveMouseInstant(1700, 700);
await Helpers.Sleep(100);
var result = await _screen.Grid.Scan("inventory");
LastScreenshot = await _screen.CaptureRegion(GridLayouts.Inventory.Region);
Updated?.Invoke();
return result;
}
public async Task ClearToStash()
{
Log.Information("Checking inventory for leftover items...");