fixes
This commit is contained in:
parent
5e1b5c2a48
commit
41b44d4fab
5 changed files with 32 additions and 13 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 7.3 MiB After Width: | Height: | Size: 7.1 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 MiB After Width: | Height: | Size: 5.9 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 347 KiB After Width: | Height: | Size: 323 KiB |
|
|
@ -236,7 +236,7 @@ public class BossRunExecutor : GameExecutor
|
||||||
Log.Error("Could not find Waypoint nameplate");
|
Log.Error("Could not find Waypoint nameplate");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await Sleep(500);
|
await Sleep(1500);
|
||||||
|
|
||||||
// Template match well-of-souls.png and click
|
// Template match well-of-souls.png and click
|
||||||
var match = await _screen.TemplateMatch(WellOfSoulsTemplate);
|
var match = await _screen.TemplateMatch(WellOfSoulsTemplate);
|
||||||
|
|
@ -512,7 +512,7 @@ public class BossRunExecutor : GameExecutor
|
||||||
// -- Async combat: combat runs in background, checks run on main thread --
|
// -- Async combat: combat runs in background, checks run on main thread --
|
||||||
|
|
||||||
private volatile int _combatTargetX = 1280;
|
private volatile int _combatTargetX = 1280;
|
||||||
private volatile int _combatTargetY = 720;
|
private volatile int _combatTargetY = 660;
|
||||||
private volatile int _combatJitter = 30;
|
private volatile int _combatJitter = 30;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -533,7 +533,7 @@ public class BossRunExecutor : GameExecutor
|
||||||
/// Start background combat loop, returning the task and CTS.
|
/// Start background combat loop, returning the task and CTS.
|
||||||
/// Caller must cancel + await + ReleaseAll when done.
|
/// Caller must cancel + await + ReleaseAll when done.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private (Task combatTask, CancellationTokenSource cts) StartCombatLoop(int x = 1280, int y = 720, int jitter = 30)
|
private (Task combatTask, CancellationTokenSource cts) StartCombatLoop(int x = 1280, int y = 660, int jitter = 30)
|
||||||
{
|
{
|
||||||
_combatTargetX = x;
|
_combatTargetX = x;
|
||||||
_combatTargetY = y;
|
_combatTargetY = y;
|
||||||
|
|
@ -617,7 +617,7 @@ public class BossRunExecutor : GameExecutor
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
const int screenCx = 1280;
|
const int screenCx = 1280;
|
||||||
const int screenCy = 720;
|
const int screenCy = 660;
|
||||||
const double screenToWorld = 97.0 / 835.0;
|
const double screenToWorld = 97.0 / 835.0;
|
||||||
(double X, double Y)? lastBossWorldPos = null;
|
(double X, double Y)? lastBossWorldPos = null;
|
||||||
var yoloLogCount = 0;
|
var yoloLogCount = 0;
|
||||||
|
|
@ -685,9 +685,28 @@ public class BossRunExecutor : GameExecutor
|
||||||
_lastDeathCheckMs = 0;
|
_lastDeathCheckMs = 0;
|
||||||
if (await CheckDeath()) { healthbarMissCount = 0; continue; }
|
if (await CheckDeath()) { healthbarMissCount = 0; continue; }
|
||||||
|
|
||||||
Log.Information("Healthbar gone for {N} checks, boss phase over after {Ms}ms, lastBossPos={Boss}",
|
Log.Information("Healthbar gone for {N} checks, boss phase over after {Ms}ms",
|
||||||
healthbarMissCount, sw.ElapsedMilliseconds,
|
healthbarMissCount, sw.ElapsedMilliseconds);
|
||||||
lastBossWorldPos != null ? $"({lastBossWorldPos.Value.X:F1},{lastBossWorldPos.Value.Y:F1})" : "null");
|
|
||||||
|
// Keep polling YOLO briefly — boss death animation can move it further.
|
||||||
|
// Use the LAST detection (not furthest) so we end up where the boss actually is.
|
||||||
|
var postDeathSw = Stopwatch.StartNew();
|
||||||
|
while (postDeathSw.ElapsedMilliseconds < 2000)
|
||||||
|
{
|
||||||
|
if (_stopped) break;
|
||||||
|
var postSnapshot = _bossDetector.Latest;
|
||||||
|
if (postSnapshot.Bosses.Count > 0)
|
||||||
|
{
|
||||||
|
var boss = postSnapshot.Bosses[0];
|
||||||
|
var wp = _nav.WorldPosition;
|
||||||
|
var bx = wp.X + (boss.Cx - screenCx) * screenToWorld;
|
||||||
|
var by = wp.Y + (boss.Cy - screenCy) * screenToWorld;
|
||||||
|
lastBossWorldPos = (bx, by);
|
||||||
|
FightPosition = lastBossWorldPos;
|
||||||
|
Log.Information("Post-death YOLO: bossWorld=({Bx:F1},{By:F1})", bx, by);
|
||||||
|
}
|
||||||
|
await Sleep(100);
|
||||||
|
}
|
||||||
return lastBossWorldPos;
|
return lastBossWorldPos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -754,8 +773,8 @@ public class BossRunExecutor : GameExecutor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private async Task ClickClosestTemplateToCenter(string templatePath)
|
private async Task ClickClosestTemplateToCenter(string templatePath)
|
||||||
{
|
{
|
||||||
const int screenCx = 2560 / 2;
|
const int screenCx = 1280;
|
||||||
const int screenCy = 1440 / 2;
|
const int screenCy = 660;
|
||||||
|
|
||||||
// Search center region only to avoid clicking distant matches
|
// Search center region only to avoid clicking distant matches
|
||||||
var centerRegion = new Region(850, 50, 860, 550);
|
var centerRegion = new Region(850, 50, 860, 550);
|
||||||
|
|
@ -800,7 +819,7 @@ public class BossRunExecutor : GameExecutor
|
||||||
Log.Information("Walking to world ({X:F0},{Y:F0})", worldX, worldY);
|
Log.Information("Walking to world ({X:F0},{Y:F0})", worldX, worldY);
|
||||||
|
|
||||||
const int screenCx = 1280;
|
const int screenCx = 1280;
|
||||||
const int screenCy = 720;
|
const int screenCy = 660;
|
||||||
|
|
||||||
var sw = Stopwatch.StartNew();
|
var sw = Stopwatch.StartNew();
|
||||||
var heldKeys = new HashSet<int>();
|
var heldKeys = new HashSet<int>();
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class CombatManager
|
||||||
|
|
||||||
// Smoothed mouse position — lerps toward target to avoid jitter
|
// Smoothed mouse position — lerps toward target to avoid jitter
|
||||||
private double _smoothX = 1280;
|
private double _smoothX = 1280;
|
||||||
private double _smoothY = 720;
|
private double _smoothY = 660;
|
||||||
private const double SmoothFactor = 0.25; // 0=no movement, 1=instant snap
|
private const double SmoothFactor = 0.25; // 0=no movement, 1=instant snap
|
||||||
|
|
||||||
public bool IsHolding => _holding;
|
public bool IsHolding => _holding;
|
||||||
|
|
@ -148,7 +148,7 @@ public class CombatManager
|
||||||
_orbitIndex = -1;
|
_orbitIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int screenCx = 1280, screenCy = 720;
|
const int screenCx = 1280, screenCy = 660;
|
||||||
var cx = _chaseX;
|
var cx = _chaseX;
|
||||||
var cy = _chaseY;
|
var cy = _chaseY;
|
||||||
var dx = cx - screenCx;
|
var dx = cx - screenCx;
|
||||||
|
|
@ -256,7 +256,7 @@ public class CombatManager
|
||||||
_holding = false;
|
_holding = false;
|
||||||
_manaStableCount = 0;
|
_manaStableCount = 0;
|
||||||
_smoothX = 1280;
|
_smoothX = 1280;
|
||||||
_smoothY = 720;
|
_smoothY = 660;
|
||||||
await ReleaseOrbit();
|
await ReleaseOrbit();
|
||||||
await ReleaseChaseKeys();
|
await ReleaseChaseKeys();
|
||||||
_chaseX = -1;
|
_chaseX = -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue