26 Commits

Author SHA1 Message Date
52b10eda3d feat: add Discord alerting for cron job start/end with alert-bridge integration 2026-08-01 23:31:00 +09:00
509fb27fd8 Refactor Common Shop item selection to use OCR-based name matching
- Updated `COMMON_SHOP_TARGETS` to use item names and expected prices instead of fixed grid positions.
- Introduced `SHOP_NAME_OCR_OFFSET` for accurate name recognition in the shop grid.
- Implemented `select_targets_by_name` function to handle item selection based on OCR'd names and prices, addressing issues with item position drift due to sold-out items.
- Enhanced the purchasable button check to rely on blue tint rather than brightness, ensuring accurate detection of available items.
- Adjusted `run_shop_tab` to utilize the new selection function for Common Shop tasks.
- Documented changes and rationale in `plan.md`, including live testing results confirming successful item purchases.
2026-08-01 22:49:09 +09:00
bf87a097c3 feat: add manual pause functionality to prevent automation during user play sessions 2026-07-29 17:21:31 +09:00
a5d70e5ec6 Refactor story_sweep.py to align with story_sweep_hard.py best practices and add campaign-active guard
- Rewrote story_sweep.py to incorporate fixes from story_sweep_hard.py's Phase 21, addressing latent bugs and improving functionality.
- Introduced a campaign-active guard for Normal mode, ensuring AP is only spent when the reward campaign banner is visible.
- Added explicit Normal-tab navigation and self-healing checks to maintain task screen integrity.
- Updated click functions for MAX and PLUS buttons to remove reliance on visible count increases, addressing false-negative issues.
- Implemented OCR verification for the sweep confirmation dialog to prevent misclicks on stacked buttons.
- Enhanced region reading with retry logic for transient OCR failures.
- Added force parameter to run function, allowing bypass of campaign checks via story_sweep_force command.
- Updated ba_daily.py to include new force commands for both story_sweep and story_sweep_hard.
- Documented changes and live-tested functionality to ensure reliability and correctness.
2026-07-22 23:07:43 +09:00
0e3f2d951c feat: Implement hard story AP sweep functionality
- Added `story_sweep_hard.py` to handle a fixed, priority-ordered list of Hard-mode story stages, gated by an active drop-rate/reward campaign.
- Introduced `HARD_STORY_SWEEP_TARGETS`, `HARD_TAB`, `HARD_STAGE_ROWS_Y`, and `HARD_CAMPAIGN_BADGE_RECT` in the config for managing Hard sweep settings.
- Integrated `story_sweep_hard` and `story_sweep_hard_force` commands into the daily task flow, allowing for optional bypass of the campaign check.
- Enhanced navigation and error handling in the sweep process, addressing multiple bugs found during live testing, including navigation-cascade issues and real-money hazards.
- Documented the implementation and testing results in `plan.md`, confirming successful live sweeps and robust error handling.
2026-07-21 00:09:10 +09:00
b8ac8db01e feat(deployment): simplify runtime paths to run directly from the git checkout 2026-07-18 22:04:17 +09:00
5a78e8ef11 feat(cron): Implement cron scheduling for daily and q4h presets with logging and locking 2026-07-16 13:29:25 +09:00
e814b3d803 feat(cafe): implement student invitation and horizontal camera panning
- Added functionality to invite students into the cafe before farming, prioritizing the highest-affection candidates while skipping those that would cause costume swaps or move students from other rooms. This follows user direction from 2026-07-14.
- Introduced a new drag method for horizontal camera panning to reveal hidden content in the cafe, addressing user feedback regarding screen size limitations. The camera pans to both extremes before farming, ensuring all students are visible.
- Updated the cafe task logic to incorporate the new invitation and panning features, ensuring a seamless user experience with real-time confirmations and checks.
- Live-tested and confirmed the new features with real game-state changes, ensuring functionality aligns with user requirements and expectations.
2026-07-14 22:28:44 +09:00
84790ecb27 refactor(navigation): enhance overlay handling and unify back navigation logic across tasks 2026-07-14 19:53:22 +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
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
a1806b421e fix(lesson): resolve ticket count OCR regression and navigation issues 2026-07-10 10:52:42 +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
9f4d8f4361 feat(story_sweep): add daily-rotating target for story sweeps and update configuration 2026-07-08 23:55:00 +09:00
51ad297f69 feat: Implement Lesson/Schedule task
- Added `lesson.py` to handle the scheduling of lessons based on affection values.
- Integrated OCR functionality to read affection counts from heart badges.
- Updated `README.md` to include the new lesson task in the task status section.
- Enhanced `config.py` with necessary configurations for the lesson task.
- Modified `detector.py` to include a new function for reading heart badge values accurately.
- Updated `mapping.md` to reflect the new lesson task implementation.
- Adjusted `ba_daily.py` to include the lesson task in the command dispatch.
- Updated `plan.md` to document the completion of the lesson task and its testing outcomes.
- Modified `setup.sh` to include the lesson task in the run command instructions.
2026-07-08 23:45:18 +09:00
1bb2ccdd6f feat: Add Common Shop and Tactical Shop tasks with shared purchasing logic 2026-07-07 23:08:31 +09:00
4842d575a5 docs: Update CLAUDE.md to clarify project goals, OCR policy, and migration details 2026-07-07 22:26:37 +09:00
b2ed571908 feat(cafe): handle bond rank-up cutscene during pat loop and improve state verification 2026-07-06 01:58:01 +09:00
a8ff95d6f5 feat: Implement OCR-driven story AP sweep with deterministic stage targeting
- Added `wait_for_state` function in `navigation.py` for state monitoring and reaction handling.
- Updated `mapping.md` to reflect changes in story sweep implementation and OCR usage.
- Refactored `story_sweep.py` to utilize OCR for region and stage identification, replacing random selection with configured targets.
- Enhanced modal handling and confirmation checks for AP usage in `story_sweep.py`.
- Updated setup script to require `tesseract` for OCR functionality and included installation instructions.
- Revised `plan.md` to document the transition from heuristic to OCR-based stage targeting and the associated findings from live testing.
2026-07-06 01:41:58 +09:00
0707487934 Enhance automation project with story sweep feature and OCR policy updates
- Introduced `story_sweep.py` for Normal/Hard story AP sweeping, allowing users to spend AP on randomly selected stages.
- Updated `CLAUDE.md` to clarify the OCR policy, emphasizing the need to port OCR-driven logic from the reference implementation rather than substituting with non-OCR methods.
- Modified `README.md` and `plan.md` to reflect the new story sweep feature and its operational details.
- Adjusted `setup.sh` to include the new command for running the story sweep.
- Enhanced `driver.py` with a new scroll function for better interaction with the game UI.
- Updated configuration mappings in `config.py` to support the new story sweep functionality.
- Refined existing task modules to ensure consistent state verification and error handling.
2026-07-05 20:19:35 +09:00
0b16399948 Refactor directory labels and update task migration status
- Changed directory labels from ".scratchpad/" to "scratchpad/" in graph.json and related documentation for consistency.
- Updated plan.md to reflect the current status of the Stamina/AP task migration, including details on the mission claim process and identified bugs.
- Modified setup.sh to include 'stamina' in the run command options for the daily script.
2026-07-05 19:15:32 +09:00
a04ef5d0c5 Refactor scratchpad directory references and update Phase 6 follow-up report
- Changed references from './scratchpad' to '.scratchpad/' in graph.json and plan.md for consistency.
- Expanded Phase 6 follow-up section in plan.md to clarify changes made to the pat detection logic:
  - Updated `find_cafe_sparkle()` to utilize multiple template scales for improved detection.
  - Modified `_pat_room` to allow polling for maximum clicks instead of breaking on the first miss.
  - Added mouse movement after each pat to prevent cursor occlusion of sparkles.
- Verified that room entry and modal state checks function correctly, but end-to-end pat success remains untested due to lack of available interactions.
2026-07-05 17:57:26 +09:00
3a4534f205 Migrate cafe and mailbox tasks to Python: replace legacy Bash scripts, implement state verification, and integrate sparkle detection. 2026-07-05 16:31:26 +09:00
398b936c64 Migrate to Python-first architecture: implement mailbox and cafe tasks, replace Bash scripts with Python CLI, and establish configuration and driver modules. 2026-07-05 16:02:02 +09:00
ebce31156b Refactor project structure and add setup script
- Transitioned the project to a Python-first architecture, moving feature logic from Bash to Python.
- Created a new `setup.sh` script to bootstrap the environment on `nik-gpu`, ensuring necessary tools are installed and setting up a Python virtual environment.
- Updated project layout in `plan.md` to reflect the new structure and clarify the purpose of each component.
- Established a reference mapping table for feature implementation based on the existing reference project.
- Outlined a migration phase to transition existing Bash functionality to Python tasks.
2026-07-05 15:24:45 +09:00
f30f35b441 Add automation scripts for Blue Archive mailbox and cafe routines 2026-07-05 04:38:52 +09:00