From e7e5ec7ffadd61ffca2d15991db357db74a63b4e Mon Sep 17 00:00:00 2001 From: sui-feng-cb <2518179942@qq.com> Date: Sun, 7 Sep 2025 02:14:13 +0800 Subject: [PATCH] Opt: call cl1 if enabled if OpSi tasks end with enough yellow coins --- module/campaign/os_run.py | 1 + module/os/map.py | 1 + module/os/operation_siren.py | 2 +- module/os_handler/os_status.py | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/module/campaign/os_run.py b/module/campaign/os_run.py index a987d4a7e..457e774c6 100644 --- a/module/campaign/os_run.py +++ b/module/campaign/os_run.py @@ -57,6 +57,7 @@ class OSCampaignRun(OSMapOperation): if get_os_reset_remain() > 0: self.config.task_delay(server_update=True) self.config.task_call('Reward', force_call=False) + self.cl1_task_call() else: logger.info('Just less than 1 day to OpSi reset, delay 2.5 hours') self.config.task_delay(minute=150, server_update=True) diff --git a/module/os/map.py b/module/os/map.py index 71143476f..5231fefc9 100644 --- a/module/os/map.py +++ b/module/os/map.py @@ -583,6 +583,7 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler): logger.info(f'Keep {OpsiMeowfficerFarming_ActionPointPreservse} AP when CL1 available') if not self.action_point_check(OpsiMeowfficerFarming_ActionPointPreservse): self.config.opsi_task_delay(cl1_preserve=True) + self.cl1_task_call() self.config.task_stop() _auto_search_battle_count = 0 diff --git a/module/os/operation_siren.py b/module/os/operation_siren.py index 85f481255..b88018b87 100644 --- a/module/os/operation_siren.py +++ b/module/os/operation_siren.py @@ -554,7 +554,7 @@ class OperationSiren(OSMap): if self.get_yellow_coins() < self.config.OpsiHazard1Leveling_OperationCoinsPreserve: logger.info(f'Reach the limit of yellow coins, preserve={self.config.OpsiHazard1Leveling_OperationCoinsPreserve}') with self.config.multi_set(): - self.config.task_delay(minute=30, server_update=True) + self.config.task_delay(minute=27, server_update=True) if not self.is_in_opsi_explore(): cd = self.nearest_task_cooling_down if cd is None: diff --git a/module/os_handler/os_status.py b/module/os_handler/os_status.py index 266a89526..9c820b942 100644 --- a/module/os_handler/os_status.py +++ b/module/os_handler/os_status.py @@ -99,3 +99,8 @@ class OSStatus(UI): self._shop_yellow_coins = self.get_yellow_coins() self._shop_purple_coins = self.get_purple_coins() logger.info(f'Yellow coins: {self._shop_yellow_coins}, purple coins: {self._shop_purple_coins}') + + def cl1_task_call(self): + if self.is_cl1_enabled and self.get_yellow_coins() > self.config.cross_get( + keys='OpsiHazard1Leveling.OpsiHazard1Leveling.OperationCoinsPreserve'): + self.config.task_call('OpsiHazard1Leveling')