5 Commits

Author SHA1 Message Date
a30c3888d6 fix: address multiple bugs causing incorrect battle handling and result screen issues
- In arena.py, widened RESULT_MODAL_MAX_POLLS to 200 to accommodate real battle durations and added early exit check in _wait_for_result to prevent stuck screens.
- Updated _fight_one to properly handle _wait_for_result's return value, ensuring failures stop the fight loop.
- In bounty.py, implemented OCR verification in _confirm_dialog_is_sweep to ensure the correct confirmation dialog is displayed before proceeding with sweeps, preventing unintended battles.
- Documented hazards and fixes in plan.md, detailing incidents from 2026-07-17 that led to these changes.
2026-07-18 12:31:42 +09:00
c5873f4e58 Refactor arena and lesson tasks for improved efficiency and reliability
- Updated arena.py to allow multiple battles per invocation, looping until tickets are exhausted or a rank-1 condition is met. Introduced _fight_one function for single battle logic and added cooldown handling between fights.
- Enhanced lesson.py to implement a tiered priority system for scheduling lessons based on student slots available, replacing the previous highest affection value selection. Introduced functions for scanning all regions and building a priority queue for lesson scheduling.
- Centralized return-to-home logic in ba_daily.py to ensure the game returns to the home screen before and after each task, improving robustness against navigation issues.
- Added retry mechanism for returning to home, allowing for transient navigation issues to be handled gracefully without aborting tasks.
2026-07-13 10:32:53 +09:00
634d77d9d2 feat(clean_scratchpad): implement script for safe deletion of temporary files in scratchpad directory
fix(arena): resolve consecutive-invocation navigation issue by ensuring return to home before opening Tactical Challenge
docs(mapping): update Arena task description with navigation bug fix details
2026-07-11 00:20:04 +09:00
568e17d244 Refactor event sweep and arena tasks; enhance OCR and navigation reliability
- Updated `mapping.md` to reflect completed migration and testing status for event sweep and arena tasks.
- Improved `arena.py` to ensure a return to home screen before opening tactical challenges, preventing navigation errors.
- Enhanced `event_sweep.py` with robust handling for badge carousel navigation, including direct pagination dot clicks and extended wait times for cold-start scenarios.
- Implemented Japanese OCR support for finished event detection in `event_sweep.py`, adding a definitive check to avoid false positives on stale event pages.
- Adjusted retry logic and timeouts in `event_sweep.py` to accommodate longer loading times and ensure accurate stage row detection.
- Updated `setup.sh` to check for the presence of the Japanese OCR language pack, providing installation instructions if missing.
- Documented live testing results and fixes in `plan.md`, confirming successful sweeps and addressing previously reported bugs.
2026-07-11 00:04:50 +09:00
511010b6d6 feat: Implement arena task with OCR and auto-fight capabilities
- Added `find_template` and `template_visible` functions for template matching in screenshots.
- Introduced `read_int_white_on_dark` for OCR of bright text on dark backgrounds.
- Ported arena functionality from reference, including ticket management, opponent selection, and reward collection.
- Implemented safety checks for modal visibility and result confirmation to prevent unintended ticket spends.
- Live-tested the arena task, confirming functionality across multiple tickets with real fight outcomes.
- Updated mapping documentation to reflect new arena task implementation and its unique navigation requirements.
2026-07-09 02:38:41 +09:00