kulemak working pretty good, just need better tracking
This commit is contained in:
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 |
Binary file not shown.
|
Before Width: | Height: | Size: 6 MiB After Width: | Height: | Size: 6.1 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 340 KiB After Width: | Height: | Size: 336 KiB |
|
|
@ -390,7 +390,7 @@ public class BossRunExecutor : GameExecutor
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for death animation + loot settle, keep updating fight position from YOLO
|
// 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)
|
if (deathPos != null)
|
||||||
{
|
{
|
||||||
fightWorldX = deathPos.Value.X;
|
fightWorldX = deathPos.Value.X;
|
||||||
|
|
@ -399,7 +399,7 @@ public class BossRunExecutor : GameExecutor
|
||||||
|
|
||||||
// Walk to well and click the closest match to screen center
|
// Walk to well and click the closest match to screen center
|
||||||
Log.Information("Phase {Phase} done, walking to well", phase);
|
Log.Information("Phase {Phase} done, walking to well", phase);
|
||||||
await Sleep(1500);
|
await Sleep(500);
|
||||||
await WalkToWorldPosition(wellWorldX, wellWorldY);
|
await WalkToWorldPosition(wellWorldX, wellWorldY);
|
||||||
await Sleep(500);
|
await Sleep(500);
|
||||||
await ClickClosestTemplateToCenter(CathedralWellTemplate);
|
await ClickClosestTemplateToCenter(CathedralWellTemplate);
|
||||||
|
|
@ -461,8 +461,8 @@ public class BossRunExecutor : GameExecutor
|
||||||
Log.Information("Walking to fight position ({X:F0},{Y:F0})", fightWorldX, fightWorldY);
|
Log.Information("Walking to fight position ({X:F0},{Y:F0})", fightWorldX, fightWorldY);
|
||||||
await WalkToWorldPosition(fightWorldX, fightWorldY, cancelWhen: IsBossAlive);
|
await WalkToWorldPosition(fightWorldX, fightWorldY, cancelWhen: IsBossAlive);
|
||||||
await Sleep(300);
|
await Sleep(300);
|
||||||
Log.Information("Attacking at ring fight position");
|
Log.Information("Attacking at ring fight position (no chase — boss will come to us)");
|
||||||
await AttackBossUntilGone(fightWorldX, fightWorldY);
|
await AttackBossUntilGone(fightWorldX, fightWorldY, chase: false);
|
||||||
if (_stopped) return;
|
if (_stopped) return;
|
||||||
|
|
||||||
StopBossDetection();
|
StopBossDetection();
|
||||||
|
|
@ -625,7 +625,8 @@ public class BossRunExecutor : GameExecutor
|
||||||
/// Returns the last world position where YOLO spotted the boss, or null.
|
/// Returns the last world position where YOLO spotted the boss, or null.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private async Task<(double X, double Y)?> AttackBossUntilGone(
|
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
|
// Wait for boss to actually appear before attacking
|
||||||
if (!await WaitForBossSpawn())
|
if (!await WaitForBossSpawn())
|
||||||
|
|
@ -637,15 +638,14 @@ public class BossRunExecutor : GameExecutor
|
||||||
(double X, double Y)? lastBossWorldPos = null;
|
(double X, double Y)? lastBossWorldPos = null;
|
||||||
var yoloLogCount = 0;
|
var yoloLogCount = 0;
|
||||||
|
|
||||||
// Subscribe to YOLO events for real-time chase updates
|
// Subscribe to YOLO events — aim mouse at boss, optionally chase with WASD
|
||||||
// (main loop is too slow due to template matching to effectively track boss)
|
|
||||||
void OnBossDetected(BossSnapshot snapshot)
|
void OnBossDetected(BossSnapshot snapshot)
|
||||||
{
|
{
|
||||||
if (snapshot.Bosses.Count == 0) return;
|
if (snapshot.Bosses.Count == 0) return;
|
||||||
var boss = snapshot.Bosses[0];
|
var boss = snapshot.Bosses[0];
|
||||||
_combatTargetX = boss.Cx;
|
_combatTargetX = boss.Cx;
|
||||||
_combatTargetY = boss.Cy;
|
_combatTargetY = boss.Cy;
|
||||||
_combat.SetChaseTarget(boss.Cx, boss.Cy);
|
if (chase) _combat.SetChaseTarget(boss.Cx, boss.Cy);
|
||||||
}
|
}
|
||||||
_bossDetector.BossDetected += OnBossDetected;
|
_bossDetector.BossDetected += OnBossDetected;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue