ba-auto-daily/ba_daily.py
Nik Afiq 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

44 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""Python CLI entry point: ba_dailies.sh -> ba_daily.py -> ba_auto/tasks/*.py"""
import sys
from ba_auto import config, driver
from ba_auto.tasks import cafe, lesson, mailbox, shop_common, shop_tactical, stamina, story_sweep
TASKS = {
"mailbox": mailbox.run,
"cafe": cafe.run,
"stamina": stamina.run,
"story_sweep": story_sweep.run,
"shop_common": shop_common.run,
"shop_tactical": shop_tactical.run,
"lesson": lesson.run,
}
# story_sweep, both shop tasks, and lesson are opt-in only (not in the
# default flow): they spend AP/credits/tactical coin/lesson tickets on an
# automated choice rather than reclaiming something free, which is a real
# resource decision the default unattended run shouldn't make blindly.
DEFAULT_ORDER = ["mailbox", "cafe", "stamina"]
def main(argv):
args = argv[1:]
if not args:
for name in DEFAULT_ORDER:
TASKS[name](driver, config)
print("All done.")
return 0
command = args[0]
if command not in TASKS:
print(f"Unknown phase: {command}", file=sys.stderr)
return 1
TASKS[command](driver, config)
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))