babalae/better-genshin-impact · error · Exception

导航到地脉花失败:超时未检测到奖励或交互文字

Error message

导航到地脉花失败:超时未检测到奖励或交互文字

What it means

Thrown by AutoNavigateToReward (the navigation loop) when it runs for the full timeoutMs without detecting either the reward page or an interaction text. The character kept moving but never reached a confirmable interaction.

Source

Thrown at BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs:1465

            Simulation.SendInput.Mouse.MiddleButtonClick();
            await Delay(300, _ct);

            if (await NavigateTowardReward(60000))
            {
                _logger.LogInformation("已到达领取奖励页面");
                return;
            }

            Simulation.SendInput.SimulateAction(GIActions.MoveForward, KeyType.KeyUp);
            Simulation.SendInput.Keyboard.KeyPress(User32.VK.VK_X);
            await Delay(500, _ct);
            Simulation.SendInput.SimulateAction(GIActions.MoveBackward, KeyType.KeyDown);
            await Delay(1000, _ct);
            Simulation.SendInput.SimulateAction(GIActions.MoveBackward, KeyType.KeyUp);
            await Delay(500, _ct);
        }

        throw new Exception("导航到地脉花失败:超时未检测到奖励或交互文字");
    }

    private async Task<bool> NavigateTowardReward(int timeoutMs)
    {
        var start = DateTime.UtcNow;
        try
        {
            while ((DateTime.UtcNow - start).TotalMilliseconds < timeoutMs)
            {
                // If reward UI is detected, stop moving.
                if (await DetectRewardPage())
                {
                    _logger.LogInformation("检测到奖励/交互文字,停止导航");
                    return true;
                }

                using var capture = CaptureToRectArea();
                if (_paimonMenuRo != null && capture.Find(_paimonMenuRo).IsEmpty())

View on GitHub (pinned to a7cb36712d)

Solutions

  1. Increase the navigation timeout passed to the method.
  2. Verify the character starts close to the blossom (check the teleport/route node).
  3. Ensure resolution and OCR quality so the interaction text is readable.
  4. Clear obstacles / use a route node that places the character in the open.
Defensive patterns

Strategy: retry

Try / catch

try { await AutoNavigateToReward(timeoutMs); }
catch (Exception ex) when (ex.Message.Contains("导航到地脉花失败"))
{
    _logger.LogWarning("导航超时,重试一次: {Msg}", ex.Message);
    await AutoNavigateToReward(timeoutMs * 2);
}

Prevention

When it happens

Trigger: The while-loop in the navigation method runs until (DateTime.UtcNow - start).TotalMilliseconds >= timeoutMs with no DetectRewardPage success and no interaction text found; it then presses X / moves back as cleanup and throws.

Common situations: Character stuck against terrain; blossom not actually nearby after teleport; vision/OCR failing to detect the interaction prompt; timeout too short for the distance.

Related errors


AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13). Data as JSON: /api/errors/4b7e96987c181ccb. Report an issue: GitHub.