|
@@ -4,7 +4,7 @@
|
|
|
# @note draft version without full test
|
|
# @note draft version without full test
|
|
|
# github https://github.com/roarhill/oas
|
|
# github https://github.com/roarhill/oas
|
|
|
|
|
|
|
|
-from datetime import datetime
|
|
|
|
|
|
|
+from datetime import datetime, timedelta
|
|
|
import random
|
|
import random
|
|
|
import numpy as np
|
|
import numpy as np
|
|
|
from enum import Enum
|
|
from enum import Enum
|
|
@@ -159,7 +159,23 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AbyssShadowsAssets):
|
|
|
|
|
|
|
|
# 设置下次运行时间
|
|
# 设置下次运行时间
|
|
|
if success:
|
|
if success:
|
|
|
- self.set_next_run(task='AbyssShadows', finish=True, server=True, success=True)
|
|
|
|
|
|
|
+ custom_time = None
|
|
|
|
|
+ if today == 4:
|
|
|
|
|
+ # 周五推迟到周六
|
|
|
|
|
+ logger.info(f"The next abyss shadows day is Saturday")
|
|
|
|
|
+ custom_time = cfg.abyss_shadows_time.custom_run_time_saturday
|
|
|
|
|
+ target_time = (datetime.now() + timedelta(days=1)).replace(hour=custom_time.hour, minute=custom_time.minute, second=custom_time.second)
|
|
|
|
|
+ elif today == 5:
|
|
|
|
|
+ # 周六推迟到周日
|
|
|
|
|
+ logger.info(f"The next abyss shadows day is Sunday")
|
|
|
|
|
+ custom_time = cfg.abyss_shadows_time.custom_run_time_sunday
|
|
|
|
|
+ target_time = (datetime.now() + timedelta(days=1)).replace(hour=custom_time.hour, minute=custom_time.minute, second=custom_time.second)
|
|
|
|
|
+ elif today == 6:
|
|
|
|
|
+ # 周日推迟到下周五
|
|
|
|
|
+ logger.info(f"The next abyss shadows day is Friday")
|
|
|
|
|
+ custom_time = cfg.abyss_shadows_time.custom_run_time_friday
|
|
|
|
|
+ target_time = (datetime.now() + timedelta(days=5)).replace(hour=custom_time.hour, minute=custom_time.minute, second=custom_time.second)
|
|
|
|
|
+ self.set_next_run(task='AbyssShadows', target=target_time)
|
|
|
else:
|
|
else:
|
|
|
self.set_next_run(task='AbyssShadows', finish=True, server=True, success=False)
|
|
self.set_next_run(task='AbyssShadows', finish=True, server=True, success=False)
|
|
|
raise TaskEnd
|
|
raise TaskEnd
|