Skip to content

fix: auto_battle 收尾 wait_ocr 改为 skip_dialogs#61

Open
Ranch007 wants to merge 1 commit into
AliceJump:masterfrom
Ranch007:pr/skip-dialogs
Open

fix: auto_battle 收尾 wait_ocr 改为 skip_dialogs#61
Ranch007 wants to merge 1 commit into
AliceJump:masterfrom
Ranch007:pr/skip-dialogs

Conversation

@Ranch007

@Ranch007 Ranch007 commented Jun 29, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Bug Fixes
    • Improved end-of-battle handling so the app more reliably detects and responds to on-screen prompts.
    • Added better handling for pop-ups, “continue” prompts, and confirmation dialogs, reducing cases where the flow could get stuck or miss the next action.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 90aae281-ec13-4ab4-88bc-5c52338fd4ac

📥 Commits

Reviewing files that changed from the base of the PR and between 16a7bbf and 853a1d5.

📒 Files selected for processing (1)
  • src/tasks/BaseGfTask.py

📝 Walkthrough

Walkthrough

In BaseGfTask.auto_battle, the end-match loop replaces wait_ocr with skip_dialogs (using raise_if_not_found=True) and updates branching: pop_ups now triggers back(after_sleep=2) and continue; 继续前进 logs, clicks, and recurses; 确认/确认结算 clicks with after_sleep=8 and breaks.

Changes

auto_battle end_match dialog handling

Layer / File(s) Summary
skip_dialogs integration and match branching
src/tasks/BaseGfTask.py
end_match loop replaces wait_ocr with skip_dialogs(..., raise_if_not_found=True); adds immediate pop_ups back-out, retains 继续前进 recursion, and sets after_sleep=8 for 确认/确认结算 click before break.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 A rabbit once waited, then skipped right ahead,
No more wait_ocr—use skip_dialogs instead!
Pop-ups get a back(), confirmations a rest,
Eight seconds of sleep puts the dialog to bed.
Onwards to battle! The bunny knows best. 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: auto_battle's end-match flow switches from wait_ocr to skip_dialogs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ranch007

Copy link
Copy Markdown
Author

Close #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant