mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-23 13:18:01 +08:00
Fix: Handle AUTO_SEARCH_REWARD in order_enter()
This commit is contained in:
@@ -15,14 +15,29 @@ class MapOrderHandler(MapOperation, ActionPointHandler, MapEventHandler, ZoneMan
|
|||||||
def is_in_map_order(self):
|
def is_in_map_order(self):
|
||||||
return self.appear(ORDER_CHECK, offset=(20, 20))
|
return self.appear(ORDER_CHECK, offset=(20, 20))
|
||||||
|
|
||||||
def order_enter(self):
|
def order_enter(self, skip_first_screenshot=True):
|
||||||
"""
|
"""
|
||||||
Pages:
|
Pages:
|
||||||
in: is_in_map
|
in: is_in_map
|
||||||
out: is_in_map_order
|
out: is_in_map_order
|
||||||
"""
|
"""
|
||||||
self.ui_click(ORDER_ENTER, appear_button=self.is_in_map, check_button=self.is_in_map_order,
|
logger.info('Order enter')
|
||||||
skip_first_screenshot=True, additional=self.handle_map_event, retry_wait=2)
|
while 1:
|
||||||
|
if skip_first_screenshot:
|
||||||
|
skip_first_screenshot = False
|
||||||
|
else:
|
||||||
|
self.device.screenshot()
|
||||||
|
|
||||||
|
# End
|
||||||
|
if self.is_in_map_order():
|
||||||
|
break
|
||||||
|
|
||||||
|
if self.is_in_map():
|
||||||
|
if self.appear_then_click(ORDER_ENTER, offset=(20, 20), interval=2):
|
||||||
|
continue
|
||||||
|
# A game bug that AUTO_SEARCH_REWARD from the last cleared zone popups
|
||||||
|
if self.appear_then_click(AUTO_SEARCH_REWARD, offset=(50, 50), interval=3):
|
||||||
|
continue
|
||||||
|
|
||||||
def order_quit(self):
|
def order_quit(self):
|
||||||
"""
|
"""
|
||||||
@@ -30,6 +45,7 @@ class MapOrderHandler(MapOperation, ActionPointHandler, MapEventHandler, ZoneMan
|
|||||||
in: is_in_map_order
|
in: is_in_map_order
|
||||||
out: is_in_map
|
out: is_in_map
|
||||||
"""
|
"""
|
||||||
|
logger.info('Order quit')
|
||||||
self.ui_click(ORDER_CHECK, appear_button=self.is_in_map_order, check_button=self.is_in_map,
|
self.ui_click(ORDER_CHECK, appear_button=self.is_in_map_order, check_button=self.is_in_map,
|
||||||
skip_first_screenshot=True)
|
skip_first_screenshot=True)
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class StorageHandler(GlobeOperation, ZoneManager):
|
|||||||
in: is_in_map, STORAGE_ENTER
|
in: is_in_map, STORAGE_ENTER
|
||||||
out: STORAGE_CHECK
|
out: STORAGE_CHECK
|
||||||
"""
|
"""
|
||||||
|
logger.info('Storage enter')
|
||||||
while 1:
|
while 1:
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
skip_first_screenshot = False
|
skip_first_screenshot = False
|
||||||
@@ -45,6 +46,7 @@ class StorageHandler(GlobeOperation, ZoneManager):
|
|||||||
in: STORAGE_CHECK
|
in: STORAGE_CHECK
|
||||||
out: is_in_map
|
out: is_in_map
|
||||||
"""
|
"""
|
||||||
|
logger.info('Storage quit')
|
||||||
self.ui_back(STORAGE_ENTER, offset=(200, 5), skip_first_screenshot=True)
|
self.ui_back(STORAGE_ENTER, offset=(200, 5), skip_first_screenshot=True)
|
||||||
|
|
||||||
def _storage_item_use(self, button, skip_first_screenshot=True):
|
def _storage_item_use(self, button, skip_first_screenshot=True):
|
||||||
|
|||||||
Reference in New Issue
Block a user