mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-21 00:55:34 +08:00
Process Battle Status C or D
This commit is contained in:
@@ -281,7 +281,9 @@ class AutoSearchCombat(MapOperation, Combat, CampaignStatus):
|
|||||||
if self.handle_get_ship():
|
if self.handle_get_ship():
|
||||||
continue
|
continue
|
||||||
if self.appear(BATTLE_STATUS_S) or self.appear(BATTLE_STATUS_A) or self.appear(BATTLE_STATUS_B) \
|
if self.appear(BATTLE_STATUS_S) or self.appear(BATTLE_STATUS_A) or self.appear(BATTLE_STATUS_B) \
|
||||||
|
or self.appear(BATTLE_STATUS_C) or self.appear(BATTLE_STATUS_D) \
|
||||||
or self.appear(EXP_INFO_S) or self.appear(EXP_INFO_A) or self.appear(EXP_INFO_B) \
|
or self.appear(EXP_INFO_S) or self.appear(EXP_INFO_A) or self.appear(EXP_INFO_B) \
|
||||||
|
or self.appear(EXP_INFO_C) or self.appear(EXP_INFO_D) \
|
||||||
or self.is_auto_search_running():
|
or self.is_auto_search_running():
|
||||||
self.device.screenshot_interval_set()
|
self.device.screenshot_interval_set()
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -725,6 +725,7 @@ OpsiHazard1Leveling:
|
|||||||
OperationCoinsPreserve:
|
OperationCoinsPreserve:
|
||||||
value: 100000
|
value: 100000
|
||||||
DisableMeowfficerFarming: false
|
DisableMeowfficerFarming: false
|
||||||
|
|
||||||
# ==================== Tools ====================
|
# ==================== Tools ====================
|
||||||
|
|
||||||
Daemon:
|
Daemon:
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Device(Screenshot, Control, AppControl):
|
|||||||
detect_record = set()
|
detect_record = set()
|
||||||
click_record = collections.deque(maxlen=15)
|
click_record = collections.deque(maxlen=15)
|
||||||
stuck_timer = Timer(60, count=60).start()
|
stuck_timer = Timer(60, count=60).start()
|
||||||
stuck_timer_long = Timer(180, count=180).start()
|
stuck_timer_long = Timer(185, count=185).start()
|
||||||
stuck_long_wait_list = ['BATTLE_STATUS_S', 'PAUSE', 'LOGIN_CHECK']
|
stuck_long_wait_list = ['BATTLE_STATUS_S', 'PAUSE', 'LOGIN_CHECK']
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ class Ship:
|
|||||||
status: str = ''
|
status: str = ''
|
||||||
button: Any = None
|
button: Any = None
|
||||||
|
|
||||||
def satisfy_limitation(self, limitaion) -> bool:
|
def satisfy_limitation(self, limitation) -> bool:
|
||||||
for key in self.__dict__:
|
for key in self.__dict__:
|
||||||
value = limitaion.get(key)
|
value = limitation.get(key)
|
||||||
if self.__dict__[key] is not None and value is not None:
|
if self.__dict__[key] is not None and value is not None:
|
||||||
# str and int should be exactly equal to
|
# str and int should be exactly equal to
|
||||||
if isinstance(value, (str, int)):
|
if isinstance(value, (str, int)):
|
||||||
@@ -310,7 +310,7 @@ class ShipScanner(Scanner):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
self._results = []
|
self._results = []
|
||||||
self.grids = CARD_GRIDS
|
self.grids = CARD_GRIDS
|
||||||
self.limitaion: Dict[str, Union[str, int, Tuple[int, int]]] = {
|
self.limitation: Dict[str, Union[str, int, Tuple[int, int]]] = {
|
||||||
'level': (1, 125),
|
'level': (1, 125),
|
||||||
'emotion': (0, 150),
|
'emotion': (0, 150),
|
||||||
'rarity': 'any',
|
'rarity': 'any',
|
||||||
@@ -360,7 +360,7 @@ class ShipScanner(Scanner):
|
|||||||
def scan(self, image, cached=False, output=True) -> Union[List, None]:
|
def scan(self, image, cached=False, output=True) -> Union[List, None]:
|
||||||
ships = super().scan(image, cached, output)
|
ships = super().scan(image, cached, output)
|
||||||
if not cached:
|
if not cached:
|
||||||
return [ship for ship in ships if ship.satisfy_limitation(self.limitaion)]
|
return [ship for ship in ships if ship.satisfy_limitation(self.limitation)]
|
||||||
|
|
||||||
def move(self, vector) -> None:
|
def move(self, vector) -> None:
|
||||||
"""
|
"""
|
||||||
@@ -373,14 +373,14 @@ class ShipScanner(Scanner):
|
|||||||
|
|
||||||
def limit_value(self, key, value) -> None:
|
def limit_value(self, key, value) -> None:
|
||||||
if value is None:
|
if value is None:
|
||||||
self.limitaion[key] = None
|
self.limitation[key] = None
|
||||||
elif isinstance(value, tuple):
|
elif isinstance(value, tuple):
|
||||||
lower, upper = value
|
lower, upper = value
|
||||||
lower = self.sub_scanners[key].limit_value(lower)
|
lower = self.sub_scanners[key].limit_value(lower)
|
||||||
upper = self.sub_scanners[key].limit_value(upper)
|
upper = self.sub_scanners[key].limit_value(upper)
|
||||||
self.limitaion[key] = (lower, upper)
|
self.limitation[key] = (lower, upper)
|
||||||
else:
|
else:
|
||||||
self.limitaion[key] = self.sub_scanners[key].limit_value(value)
|
self.limitation[key] = self.sub_scanners[key].limit_value(value)
|
||||||
|
|
||||||
def enable(self, *args) -> None:
|
def enable(self, *args) -> None:
|
||||||
"""
|
"""
|
||||||
@@ -419,11 +419,11 @@ class ShipScanner(Scanner):
|
|||||||
'in_event_fleet',
|
'in_event_fleet',
|
||||||
]
|
]
|
||||||
"""
|
"""
|
||||||
for attr in self.limitaion.keys():
|
for attr in self.limitation.keys():
|
||||||
value = kwargs.get(attr, self.limitaion[attr])
|
value = kwargs.get(attr, self.limitation[attr])
|
||||||
self.limit_value(key=attr, value=value)
|
self.limit_value(key=attr, value=value)
|
||||||
|
|
||||||
logger.info(f'Limitaions set to {self.limitaion}')
|
logger.info(f'Limitaions set to {self.limitation}')
|
||||||
|
|
||||||
|
|
||||||
class DockScanner(ShipScanner):
|
class DockScanner(ShipScanner):
|
||||||
|
|||||||
Reference in New Issue
Block a user