Skip to content

Currently, this implementation focuses on collecting achievements. #837

Open
kingchenc wants to merge 3 commits intoLmeSzinc:masterfrom
kingchenc:master
Open

Currently, this implementation focuses on collecting achievements. #837
kingchenc wants to merge 3 commits intoLmeSzinc:masterfrom
kingchenc:master

Conversation

@kingchenc
Copy link

Like I said on Discord, Im adding this because its such a headache to collect them manually. :D

Currently, this implementation focuses on collecting achievements. The structure is designed to be extensible, allowing for future enhancements such as collecting event rewards or other in-game rewards as needed.

  • Core routine for navigating to achievement areas.
    -Image-based detection and interaction with claim buttons. Logic to handle scrolling and processing multiple sets of rewards. Ensured screen state is up-to-date for image detection by adding self.device.screenshot() calls after screen-changing actions.

…e structure is designed to be extensible, allowing for future enhancements such as collecting event rewards, daily check-ins, or other in-game rewards as needed.

Key changes include:
Core routine for navigating to achievement areas.
Image-based detection and interaction with claim buttons.
Logic to handle scrolling and processing multiple sets of rewards.
Ensured screen state is up-to-date for image detection by adding self.device.screenshot() calls after screen-changing actions.
@kingchenc kingchenc closed this May 12, 2025
@kingchenc
Copy link
Author

i update later

@LmeSzinc
Copy link
Owner

read dev docs first https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/1.-Start
using sleep is not allowed, run python -m dev_tools.button_extract and python -m module.config.config_updater to generate assets and gui settings

@LmeSzinc LmeSzinc added the feature request / 功能请求 New feature or requests label May 12, 2025
@kingchenc
Copy link
Author

Okay thanks sir, I will stick to not using sleep and those two files for generating assets and GUI settings.

I adding universe rewards too, but I am on holiday now - will update when I am back.

- Reworked `SimulatedUniverseCollector`:
    - Implemented iterative collection logic for Blessings, Occurrences, and Curios to handle multiple pages/refreshes by going back and re-entering sections.
    - Replaced potentially buggy swipe logic with the back/re-enter strategy.
    - Added helper methods for clicking coordinates and attempting claims for each index section.
- Reworked `AchievementsCollector` (logic updated in previous commits).
- Established `RewardCollector` as the main orchestrator/scheduler for running the individual collection tasks (Achievements, SU).
- I pretty much wiped all the sleep delays and added while timers instead.
- Adding to Scheduler if anyone need it. (like me for fresh account :D)
- General code cleanup and removal of comments/unused code within the reward collection modules.
@kingchenc kingchenc reopened this May 13, 2025
@kingchenc
Copy link
Author

@LmeSzinc Had a bit of time before holiday, reworked main collector, achievement collector, simulated universe collector and more... check it out.

Still some left for automatic reward collecting, but not yet - if I get more time, I will add more.

@LmeSzinc
Copy link
Owner

read this also https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/4.4.-State-loop

  1. To write a robust bot you need to imagine every operation have a chance to fail, every clicks may not be responded, every sleep may not lead to the next game page. We use the state loop to ensure everything must success or raise error, which contains retry mechanics and wait mechanics.
  2. Don't use adb_shell(['input', 'keyevent', '111']). SRC has several underlaying device control implementation not just adb, to go back you need to click the back button and confirm it reached the target page. Also, KEYCODE_ESCAPE is vary on game clients. cloud games and some apps would treat as close app.
  3. Coordinates should not be manually written, unless they are arbitary values that don't need to be exact, they should be maintained by assets

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

Labels

feature request / 功能请求 New feature or requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants