mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-03 16:57:48 +08:00
Fix: Don't wait tasks of tomorrow
This commit is contained in:
@@ -3,6 +3,7 @@ from datetime import datetime, timedelta
|
|||||||
|
|
||||||
from module.base.timer import Timer
|
from module.base.timer import Timer
|
||||||
from module.config.config import Function
|
from module.config.config import Function
|
||||||
|
from module.config.utils import get_server_next_update
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.map.map_grids import SelectedGrids
|
from module.map.map_grids import SelectedGrids
|
||||||
from module.ocr.ocr import Digit
|
from module.ocr.ocr import Digit
|
||||||
@@ -33,6 +34,7 @@ class OSStatus(UI):
|
|||||||
such as recon scan cooldown and submarine call cooldown.
|
such as recon scan cooldown and submarine call cooldown.
|
||||||
"""
|
"""
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
update = get_server_next_update('00:00')
|
||||||
cd_tasks = [
|
cd_tasks = [
|
||||||
'OpsiObscure',
|
'OpsiObscure',
|
||||||
'OpsiAbyssal',
|
'OpsiAbyssal',
|
||||||
@@ -42,7 +44,7 @@ class OSStatus(UI):
|
|||||||
|
|
||||||
def func(task: Function):
|
def func(task: Function):
|
||||||
if task.command in cd_tasks and task.enable:
|
if task.command in cd_tasks and task.enable:
|
||||||
if task.next_run - now <= timedelta(minutes=60):
|
if task.next_run != update and task.next_run - now <= timedelta(minutes=60):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user