diff --git a/debug_loot_capture.png b/debug_loot_capture.png index 68ec639..564601c 100644 Binary files a/debug_loot_capture.png and b/debug_loot_capture.png differ diff --git a/debug_loot_detected.png b/debug_loot_detected.png index b30698b..4feb9c3 100644 Binary files a/debug_loot_detected.png and b/debug_loot_detected.png differ diff --git a/debug_loot_edges.png b/debug_loot_edges.png index a4821ac..b690a27 100644 Binary files a/debug_loot_edges.png and b/debug_loot_edges.png differ diff --git a/src/Poe2Trade.Bot/BossRunExecutor.cs b/src/Poe2Trade.Bot/BossRunExecutor.cs index f103a6a..6ea6a96 100644 --- a/src/Poe2Trade.Bot/BossRunExecutor.cs +++ b/src/Poe2Trade.Bot/BossRunExecutor.cs @@ -457,9 +457,9 @@ public class BossRunExecutor : GameExecutor } if (_stopped) return; - // Walk back to fight area — fightWorldX/Y carries position from all phases + // Walk back to fight area — stop early if boss already spawned nearby Log.Information("Walking to fight position ({X:F0},{Y:F0})", fightWorldX, fightWorldY); - await WalkToWorldPosition(fightWorldX, fightWorldY); + await WalkToWorldPosition(fightWorldX, fightWorldY, cancelWhen: IsBossAlive); await Sleep(300); Log.Information("Attacking at ring fight position"); await AttackBossUntilGone(fightWorldX, fightWorldY); @@ -548,7 +548,7 @@ public class BossRunExecutor : GameExecutor /// Start background combat loop, returning the task and CTS. /// Caller must cancel + await + ReleaseAll when done. /// - private (Task combatTask, CancellationTokenSource cts) StartCombatLoop(int x = 1280, int y = 660, int jitter = 30) + private (Task combatTask, CancellationTokenSource cts) StartCombatLoop(int x = 1280, int y = 660, int jitter = 0) { _combatTargetX = x; _combatTargetY = y; @@ -771,7 +771,7 @@ public class BossRunExecutor : GameExecutor private async Task AttackAtPosition(int x, int y, int durationMs) { - var (combatTask, cts) = StartCombatLoop(x, y, jitter: 20); + var (combatTask, cts) = StartCombatLoop(x, y, jitter: 0); try { var sw = Stopwatch.StartNew(); @@ -790,7 +790,7 @@ public class BossRunExecutor : GameExecutor private async Task AttackUntilBossDead(int x, int y, int timeoutMs) { - var (combatTask, cts) = StartCombatLoop(x, y, jitter: 20); + var (combatTask, cts) = StartCombatLoop(x, y, jitter: 0); try { var sw = Stopwatch.StartNew(); diff --git a/src/Poe2Trade.Bot/CombatManager.cs b/src/Poe2Trade.Bot/CombatManager.cs index 2211dd7..3146a49 100644 --- a/src/Poe2Trade.Bot/CombatManager.cs +++ b/src/Poe2Trade.Bot/CombatManager.cs @@ -69,7 +69,7 @@ public class CombatManager /// /// One combat iteration: flask check, mana-based click/hold, mouse jitter toward target. /// - public async Task Tick(int x, int y, int jitter = 30) + public async Task Tick(int x, int y, int jitter = 0) { await _flasks.Tick(); await UseAbilities(); @@ -88,8 +88,8 @@ public class CombatManager _smoothX += (x - _smoothX) * SmoothFactor; _smoothY += (y - _smoothY) * SmoothFactor; - var mouseX = (int)_smoothX + Rng.Next(-jitter, jitter + 1); - var mouseY = (int)_smoothY + Rng.Next(-jitter, jitter + 1); + var mouseX = (int)_smoothX; + var mouseY = (int)_smoothY; var mana = _hudReader.Current.ManaPct;