Skip to content

Conversation

@dragonheart107
Copy link
Contributor

replaced the hardcoded sleep with an area change detection, it should work for CN, but might have issues in TW or JP since their base asset used as anchor point is non default for JP and smaller for TW (#4907)
kept debug related parts in for now

additionally 2 asset related fixes for EN, non urgent -> added in this PR:
dock amount: position and size changed, Ocr misdeteced
enhance: alas would never flag it as empty:

        def state_enhance_recommend():
            # Judge if enhance material appeared
            if not EMPTY_ENHANCE_SLOT_PLUS.match(self.device.image):
                logger.info('Material found. Try enhancing...')
                return "state_enhance_attempt"
            elif self.info_bar_count():
                logger.info('No material found for enhancement.')
                logger.info(
                    'Enhancement failed. Swiping to next ship if feasible')
                return "state_enhance_fail"

            return "state_enhance_ready"
            ```

Copy link
Owner

@LmeSzinc LmeSzinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. CampaignBonusStatistics should not inherit ButtonGrid and Timer. It will pollute the entire Alas module
  2. Don't use ocr if you don't need the exact number
  3. Never use cv2.imread and cv2.imwrite. opencv can't handle non-ascii filepath, and so many years passed by they never fixed it.

@LmeSzinc
Copy link
Owner

LmeSzinc commented Aug 2, 2025

One PR do one thing. Open another PR for the DOCK_AMOUNT thingy

@LmeSzinc LmeSzinc added the feature request / 功能请求 New feature or requests label Aug 2, 2025
@dragonheart107
Copy link
Contributor Author

dragonheart107 commented Aug 2, 2025

  1. CampaignBonusStatistics should not inherit ButtonGrid and Timer. It will pollute the entire Alas module

    1. Don't use ocr if you don't need the exact number

    2. Never use cv2.imread and cv2.imwrite. opencv can't handle non-ascii filepath, and so many years passed by they never fixed it.

for 1, create it's own class then?
2. well I kinda needed a way to verify grid and ocr was kinda the easiest since every drop has a number/amount; do you have alternative suggestion?
3. this shouldn't be an issue since these are only debug related no? would be commented or removed afterwards after getting the ok from you for the rest?

@dragonheart107 dragonheart107 marked this pull request as draft August 2, 2025 19:31
@dragonheart107
Copy link
Contributor Author

I don't really have an idea how to implement it without the OCR, since it is way to dynamic for any other check. If you have an idea pls share @LmeSzinc.

Aside from that, adjusted to your other requests;
also thinking about adding a scrolling part in since some reward screens have so many rewards that you need to scroll to see them all

@dragonheart107 dragonheart107 changed the title Fix: dropscreen with no hardcoded sleep (#4907) and EN asset fixes Fix: dropscreen with no hardcoded sleep (#4907) Aug 3, 2025
@LmeSzinc
Copy link
Owner

LmeSzinc commented Aug 4, 2025

Maybe post the debug images you collected, I'll try to find some features.

@dragonheart107

This comment was marked as resolved.

@LmeSzinc
Copy link
Owner

LmeSzinc commented Aug 5, 2025

Crop REWARD_AREA and TITLE_REWARD, TITLE_CLEARING_REWARD using the same image, use a large search area to find the title self.appear(TITLE_REWARD, offset=(200, 20)), if it appears, do REWARD_AREA.load_offset(TITLE_REWARD), REWARD_AREA.button will be moved accordingly.

Copy link
Contributor Author

@dragonheart107 dragonheart107 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had no issues testing the refactor, so should be good to merge after your OK

@dragonheart107 dragonheart107 requested a review from LmeSzinc August 8, 2025 00:31
@dragonheart107 dragonheart107 marked this pull request as ready for review August 8, 2025 00:35
@dragonheart107
Copy link
Contributor Author

@LmeSzinc could you see if it's okay to merge now?

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