mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Reduce action points waste
This commit is contained in:
parent
8b36e163ce
commit
4f2ff1a164
@ -8,6 +8,8 @@ from module.os_handler.assets import *
|
||||
from module.statistics.item import Item, ItemGrid
|
||||
from module.ui.assets import OS_CHECK
|
||||
from module.ui.ui import UI
|
||||
from module.config.utils import get_server_next_update
|
||||
from datetime import datetime
|
||||
|
||||
OCR_ACTION_POINT_REMAIN = Digit(ACTION_POINT_REMAIN, letter=(255, 219, 66), name='OCR_ACTION_POINT_REMAIN')
|
||||
OCR_ACTION_POINT_REMAIN_OS = Digit(ACTION_POINT_REMAIN_OS, letter=(239, 239, 239),
|
||||
@ -268,8 +270,13 @@ class ActionPointHandler(UI):
|
||||
if cost is None:
|
||||
cost = self.action_point_get_cost(zone, pinned)
|
||||
buy_checked = False
|
||||
time_now = get_server_next_update(daily_trigger=[datetime.now().strftime('%H:%M')])
|
||||
today_rest = 144 - time_now.hour * 6 - time_now.minute / 10
|
||||
if keep_current_ap:
|
||||
if self._action_point_total <= self.config.OS_ACTION_POINT_PRESERVE:
|
||||
if self._action_point_current + today_rest >= 200:
|
||||
logger.info(f'The sum of the current action points and the rest action points that can be obtained today exceeds 200.')
|
||||
logger.info(f'Current={self._action_point_current} Rest={today_rest}')
|
||||
elif self._action_point_total <= self.config.OS_ACTION_POINT_PRESERVE:
|
||||
logger.info(f'Reach the limit of action points, preserve={self.config.OS_ACTION_POINT_PRESERVE}')
|
||||
self.action_point_quit()
|
||||
raise ActionPointLimit
|
||||
|
||||
Loading…
Reference in New Issue
Block a user