mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Merge branch 'bug_fix' into dev
This commit is contained in:
commit
654a5d5aac
@ -283,6 +283,8 @@ class AutoSearchCombat(MapOperation, Combat):
|
||||
continue
|
||||
if self.handle_vote_popup():
|
||||
continue
|
||||
if self.handle_mission_popup_ack():
|
||||
continue
|
||||
|
||||
# Handle low emotion combat
|
||||
# Combat status
|
||||
|
||||
@ -185,11 +185,16 @@ class RewardCommission(UI, InfoHandler):
|
||||
# If daily list has commissions > 4, usually to be 5, and 1 <= urgent <= 4
|
||||
# commission list will have an animation to scroll,
|
||||
# which causes the topmost one undetected.
|
||||
if not COMMISSION_SCROLL.appear(main=self) or COMMISSION_SCROLL.cal_position(main=self) < 0.05:
|
||||
if not COMMISSION_SCROLL.appear(main=self) or COMMISSION_SCROLL.cal_position(main=self) < 0.05 or COMMISSION_SCROLL.length / COMMISSION_SCROLL.total > 0.98:
|
||||
pre_peaks = lines_detect(self.device.image)
|
||||
if not len(pre_peaks):
|
||||
return True
|
||||
self.device.screenshot()
|
||||
while 1:
|
||||
peaks = lines_detect(self.device.image)
|
||||
if not len(peaks) or peaks[0] > 67 + 117:
|
||||
if (not len(peaks) or peaks[0] > 67 + 117) and (not len(pre_peaks) or abs(peaks[0] - pre_peaks[0]) < 3):
|
||||
break
|
||||
pre_peaks = peaks
|
||||
self.device.screenshot()
|
||||
|
||||
return True
|
||||
|
||||
@ -22,6 +22,7 @@ class SupplyPack(UI):
|
||||
|
||||
logger.info(f'Buying {supply_pack}')
|
||||
executed = False
|
||||
click_count = 0
|
||||
confirm_timer = Timer(1, count=3).start()
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
@ -29,7 +30,12 @@ class SupplyPack(UI):
|
||||
else:
|
||||
self.device.screenshot()
|
||||
|
||||
if self.appear_then_click(supply_pack, offset=(20, 20), interval=3):
|
||||
if self.appear(supply_pack, offset=(20, 20), interval=3):
|
||||
if click_count >= 3:
|
||||
logger.warning(f'Failed to buy {supply_pack} after 3 trail, probably reached resource limit, skip')
|
||||
break
|
||||
self.device.click(supply_pack)
|
||||
click_count += 1
|
||||
confirm_timer.reset()
|
||||
continue
|
||||
if self.appear_then_click(BUY_CONFIRM, offset=(20, 20), interval=3):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user