kulemak working pretty good, just need better tracking

This commit is contained in:
Boki 2026-02-22 22:18:10 -05:00
parent 7b28e776d0
commit a197be4087
4 changed files with 8 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 MiB

After

Width:  |  Height:  |  Size: 7.4 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 MiB

After

Width:  |  Height:  |  Size: 6.1 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 KiB

After

Width:  |  Height:  |  Size: 336 KiB

Before After
Before After

View file

@ -390,7 +390,7 @@ public class BossRunExecutor : GameExecutor
}
// Wait for death animation + loot settle, keep updating fight position from YOLO
var deathPos = await PollYoloDuringWait(3000);
var deathPos = await PollYoloDuringWait(2000);
if (deathPos != null)
{
fightWorldX = deathPos.Value.X;
@ -399,7 +399,7 @@ public class BossRunExecutor : GameExecutor
// Walk to well and click the closest match to screen center
Log.Information("Phase {Phase} done, walking to well", phase);
await Sleep(1500);
await Sleep(500);
await WalkToWorldPosition(wellWorldX, wellWorldY);
await Sleep(500);
await ClickClosestTemplateToCenter(CathedralWellTemplate);
@ -461,8 +461,8 @@ public class BossRunExecutor : GameExecutor
Log.Information("Walking to fight position ({X:F0},{Y:F0})", fightWorldX, fightWorldY);
await WalkToWorldPosition(fightWorldX, fightWorldY, cancelWhen: IsBossAlive);
await Sleep(300);
Log.Information("Attacking at ring fight position");
await AttackBossUntilGone(fightWorldX, fightWorldY);
Log.Information("Attacking at ring fight position (no chase — boss will come to us)");
await AttackBossUntilGone(fightWorldX, fightWorldY, chase: false);
if (_stopped) return;
StopBossDetection();
@ -625,7 +625,8 @@ public class BossRunExecutor : GameExecutor
/// Returns the last world position where YOLO spotted the boss, or null.
/// </summary>
private async Task<(double X, double Y)?> AttackBossUntilGone(
double fightAreaX = double.NaN, double fightAreaY = double.NaN, int timeoutMs = 120_000)
double fightAreaX = double.NaN, double fightAreaY = double.NaN,
int timeoutMs = 120_000, bool chase = true)
{
// Wait for boss to actually appear before attacking
if (!await WaitForBossSpawn())
@ -637,15 +638,14 @@ public class BossRunExecutor : GameExecutor
(double X, double Y)? lastBossWorldPos = null;
var yoloLogCount = 0;
// Subscribe to YOLO events for real-time chase updates
// (main loop is too slow due to template matching to effectively track boss)
// Subscribe to YOLO events — aim mouse at boss, optionally chase with WASD
void OnBossDetected(BossSnapshot snapshot)
{
if (snapshot.Bosses.Count == 0) return;
var boss = snapshot.Bosses[0];
_combatTargetX = boss.Cx;
_combatTargetY = boss.Cy;
_combat.SetChaseTarget(boss.Cx, boss.Cy);
if (chase) _combat.SetChaseTarget(boss.Cx, boss.Cy);
}
_bossDetector.BossDetected += OnBossDetected;