Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed for a feature for augment conversion #4590

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

dragonheart107
Copy link
Contributor

@dragonheart107 dragonheart107 commented Feb 15, 2025

I am kinda stuck at this point and I think I simply lack the knowledge of fixing it (also sorry in advance, for the not cleaned up code and comments yet):

  1. Functional Issue with the current code (refer to module/augment/conversion_unique.py):

line 127 onwards: it often times just goes to self.augment_popup_close(), seeming to not recognize the previous ifs in the while loop

But when it does recognize them correctly, it results in failing to properly leave the popup after and instead just goes directly to swiping
see this recording:

augmentissue.mp4
  1. In module/augment/conversion_unique.py line 215 onwards:
    def conv_uniq_cycle(self, skip_first_screenshot=False):
        logger.hr('Augment conversion: Uniques', level = 3)
        interval =Timer(3)
        while interval.reached():
            if skip_first_screenshot:
                skip_first_screenshot = False
            else:
                self.device.screenshot()

            if self.is_in_gear():
                self.conv_uniq_enhance()
                continue
            if self._ship_view_swipe(-400) is True:
                continue
            if self._ship_view_swipe(-400) is False:
                break
                

How should i code it so that it stays in conv_uniq_enhance cycle as long as we are in gear and if the cycle is done it swipes once.
then if it is a different ship start again from conv_uniq_enhance;
however if ship stays the same after swipes break out of loop.

I appreciate every input for this.

@dragonheart107 dragonheart107 changed the title Augment module conversion maxing uniques Augment module conversion maxing uniques; Help needed Feb 15, 2025
@dragonheart107 dragonheart107 changed the title Augment module conversion maxing uniques; Help needed Help needed for a feature for augment conversion Feb 15, 2025
Comment on lines +105 to +114
if skip_first_screenshot:
skip_first_screenshot = False
else:
self.device.screenshot()
self.not_appear_then_click(AUGMENT_EMPTY, AUGMENT_INGEAR_CONFIRM, interval=3)

if skip_first_screenshot:
skip_first_screenshot = False
else:
self.device.screenshot()
Copy link
Owner

@LmeSzinc LmeSzinc Feb 18, 2025

Choose a reason for hiding this comment

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

  1. These code is filled with click-sleep thingy, operation success is not guaranteed
    see https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/4.4.-State-loop

Comment on lines +139 to +144
if self.appear(CONVT2_START, interval=3):
logger.hr('Conversion start')
self.appear_then_click(CONVT2_START_COST, interval=3)
#interval.reset()
self.appear_then_click(CONVT2_START, interval=3)
self.appear_then_click(CONVT2_NEW, interval=3)
Copy link
Owner

Choose a reason for hiding this comment

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

same as above

@LmeSzinc
Copy link
Owner

  1. Exit to dock and re-enter first ship after argument function calls, as game client would guarantee next ship to be the first. It's hard to detect swiping to a different ship, because users can have duplicate ships having same UI appearance.
    Check the implementation of awakening:
    while 1:
    # page_dock
    if self.appear(DOCK_EMPTY, offset=(20, 20)):
    logger.info('awaken_run finished, no ships to awaken')
    result = 'finish'
    break
    # page_dock -> SHIP_DETAIL_CHECK
    self.ship_info_enter(
    CARD_GRIDS[(0, 0)], check_button=SHIP_DETAIL_CHECK, long_click=False)
    # is_in_awaken
    result = self.awaken_ship(use_array)
    self.awaken_exit()
    # 'insufficient', 'no_exp', 'timeout'
    if result in ['no_exp', 'level_max']:
    # Awaken next ship
    continue
    if result == 'insufficient':
    logger.info('awaken_run finished, resources exhausted')
    break
    if result == 'timeout':
    logger.info(f'awaken_run finished, result={result}')
    break
    raise ScriptError(f'Unexpected awaken_ship result: {result}')

@LmeSzinc LmeSzinc added the asking a question / 提问 Asking a question, not related to bugs or feature label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asking a question / 提问 Asking a question, not related to bugs or feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants