mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-25 04:42:39 +08:00
Fix: Reduce match_result template calls, handle automation confirm in battle
Add: Explanatory comments
This commit is contained in:
@@ -186,9 +186,10 @@ class RewardGuild(UI):
|
|||||||
close_timer.reset()
|
close_timer.reset()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sim, point = TEMPLATE_OPERATIONS_ADD.match_result(self.device.image)
|
# Pseudo interval timer for template match_result calls
|
||||||
if sim > 0.85:
|
if not add_timer.started() or add_timer.reached():
|
||||||
if not add_timer.started() or add_timer.reached():
|
sim, point = TEMPLATE_OPERATIONS_ADD.match_result(self.device.image)
|
||||||
|
if sim > 0.85:
|
||||||
# Use small area to reduce random click point
|
# Use small area to reduce random click point
|
||||||
button = area_offset(area=(-2, -2, 24, 12), offset=point)
|
button = area_offset(area=(-2, -2, 24, 12), offset=point)
|
||||||
dispatch_add = Button(area=button, color=(), button=button, name='GUILD_DISPATCH_ADD')
|
dispatch_add = Button(area=button, color=(), button=button, name='GUILD_DISPATCH_ADD')
|
||||||
@@ -206,6 +207,9 @@ class RewardGuild(UI):
|
|||||||
close_timer.reset()
|
close_timer.reset()
|
||||||
|
|
||||||
if self.handle_popup_confirm('GUILD_DISPATCH'):
|
if self.handle_popup_confirm('GUILD_DISPATCH'):
|
||||||
|
# Explicit click since GUILD_DISPATCH_FLEET
|
||||||
|
# does not automatically turn into
|
||||||
|
# GUILD_DISPATCH_IN_PROGRESS after confirm
|
||||||
self.device.sleep((0.5, 0.8))
|
self.device.sleep((0.5, 0.8))
|
||||||
self.device.click(GUILD_DISPATCH_CLOSE)
|
self.device.click(GUILD_DISPATCH_CLOSE)
|
||||||
confirm_timer.reset()
|
confirm_timer.reset()
|
||||||
@@ -296,6 +300,9 @@ class RewardGuild(UI):
|
|||||||
is_loading = True
|
is_loading = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if self.handle_combat_automation_confirm():
|
||||||
|
continue
|
||||||
|
|
||||||
# End
|
# End
|
||||||
if self.is_combat_executing():
|
if self.is_combat_executing():
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user