mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-26 02:25:03 +08:00
Fix: GET_ITEMS_1 raises MapDetectionError
It was a quite rare case. The emulator sometimes treat a swipe as a click (mostly on potato pcs). If this happens while doing map_swipe(), the fleet might step on a mystery, then GET_ITEMS_1 would raise MapDetectionError.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
from module.combat.assets import GET_ITEMS_1
|
||||||
from module.exception import MapDetectionError, CampaignEnd
|
from module.exception import MapDetectionError, CampaignEnd
|
||||||
from module.handler.assets import IN_MAP, GAME_TIPS
|
from module.handler.assets import IN_MAP, GAME_TIPS
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
@@ -98,6 +99,10 @@ class Camera(MapOperation):
|
|||||||
logger.info('Perspective error cause by info bar. Waiting.')
|
logger.info('Perspective error cause by info bar. Waiting.')
|
||||||
self.handle_info_bar()
|
self.handle_info_bar()
|
||||||
return self.update(camera=camera)
|
return self.update(camera=camera)
|
||||||
|
elif self.appear(GET_ITEMS_1):
|
||||||
|
logger.warning('Items got. Trying handling mystery.')
|
||||||
|
self.handle_mystery()
|
||||||
|
return self.update(camera=camera)
|
||||||
elif self.is_in_stage():
|
elif self.is_in_stage():
|
||||||
logger.warning('Image is in stage')
|
logger.warning('Image is in stage')
|
||||||
raise CampaignEnd('Image is in stage')
|
raise CampaignEnd('Image is in stage')
|
||||||
|
|||||||
Reference in New Issue
Block a user