mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-27 02:38:22 +08:00
Opt: Dispatch timeout in case composition insufficient to be deployed
Record guild raid boss if combat successful or auto-battle disabled
This commit is contained in:
@@ -254,6 +254,7 @@ class GuildOperations(GuildBase):
|
|||||||
|
|
||||||
is_loading = False
|
is_loading = False
|
||||||
empty_timeout = Timer(3, count=6)
|
empty_timeout = Timer(3, count=6)
|
||||||
|
dispatch_count = 0
|
||||||
while 1:
|
while 1:
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
skip_first_screenshot = False
|
skip_first_screenshot = False
|
||||||
@@ -267,14 +268,19 @@ class GuildOperations(GuildBase):
|
|||||||
empty_timeout.reset()
|
empty_timeout.reset()
|
||||||
continue
|
continue
|
||||||
elif empty_timeout.reached():
|
elif empty_timeout.reached():
|
||||||
logger.warning('Fleet composition empty, cannot auto-battle Guild Raid Boss')
|
logger.warning('Fleet composition is empty, cannot auto-battle Guild Raid Boss')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if self.appear(GUILD_DISPATCH_FLEET, interval=3):
|
if self.appear(GUILD_DISPATCH_FLEET, interval=3):
|
||||||
# Button does not appear greyed out even
|
# Button does not appear greyed out even
|
||||||
# when empty fleet composition
|
# when empty fleet composition
|
||||||
if not self.appear(GUILD_DISPATCH_EMPTY_2):
|
if not self.appear(GUILD_DISPATCH_EMPTY_2):
|
||||||
self.device.click(GUILD_DISPATCH_FLEET)
|
if dispatch_count < 3:
|
||||||
|
self.device.click(GUILD_DISPATCH_FLEET)
|
||||||
|
dispatch_count += 1
|
||||||
|
else:
|
||||||
|
logger.warning('Fleet cannot be dispatched for auto-battle Guild Raid Boss, verify composition manually')
|
||||||
|
return False
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Only print once when detected
|
# Only print once when detected
|
||||||
@@ -300,10 +306,11 @@ class GuildOperations(GuildBase):
|
|||||||
out: GUILD_OPERATIONS_BOSS
|
out: GUILD_OPERATIONS_BOSS
|
||||||
"""
|
"""
|
||||||
if not self._guild_operations_boss_preparation():
|
if not self._guild_operations_boss_preparation():
|
||||||
return
|
return False
|
||||||
self.combat_execute(auto='combat_auto')
|
self.combat_execute(auto='combat_auto')
|
||||||
self.combat_status(expected_end='in_ui')
|
self.combat_status(expected_end='in_ui')
|
||||||
logger.info('Guild Raid Boss has been repelled')
|
logger.info('Guild Raid Boss has been repelled')
|
||||||
|
return True
|
||||||
|
|
||||||
def guild_operations(self):
|
def guild_operations(self):
|
||||||
# Determine the mode of operations, currently 3 are available
|
# Determine the mode of operations, currently 3 are available
|
||||||
@@ -322,9 +329,12 @@ class GuildOperations(GuildBase):
|
|||||||
else:
|
else:
|
||||||
# Limit check for Guild Raid Boss to once a day
|
# Limit check for Guild Raid Boss to once a day
|
||||||
if not self.config.record_executed_since(option=RECORD_OPTION_BOSS, since=RECORD_SINCE_BOSS):
|
if not self.config.record_executed_since(option=RECORD_OPTION_BOSS, since=RECORD_SINCE_BOSS):
|
||||||
|
skip_record = False
|
||||||
if self.appear(GUILD_BOSS_AVAILABLE):
|
if self.appear(GUILD_BOSS_AVAILABLE):
|
||||||
if self.config.ENABLE_GUILD_OPERATIONS_BOSS_AUTO:
|
if self.config.ENABLE_GUILD_OPERATIONS_BOSS_AUTO and not self._guild_operations_boss_combat():
|
||||||
self._guild_operations_boss_combat()
|
skip_record = True
|
||||||
else:
|
else:
|
||||||
logger.info('Auto-battle disabled, play manually to complete this Guild Task')
|
logger.info('Auto-battle disabled, play manually to complete this Guild Task')
|
||||||
|
|
||||||
|
if not skip_record:
|
||||||
self.config.record_save(option=RECORD_OPTION_BOSS)
|
self.config.record_save(option=RECORD_OPTION_BOSS)
|
||||||
Reference in New Issue
Block a user