1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-08-16 12:00:30 +08:00

Opt: use yellow_coins_preserve aggressively

This commit is contained in:
guoh064
2026-06-12 15:51:29 +08:00
parent f64a702270
commit 10dd242c82
6 changed files with 13 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ class OSCampaignRun(OSMapOperation):
self.config.task_delay(server_update=True) self.config.task_delay(server_update=True)
self.config.task_call('Reward') self.config.task_call('Reward')
if self.config.is_task_enabled('OpsiHazard1Leveling') \ if self.config.is_task_enabled('OpsiHazard1Leveling') \
and self.get_yellow_coins() > self.config.OS_CL1_YELLOW_COINS_PRESERVE: and self.get_yellow_coins() > self.yellow_coins_preserve:
self.config.task_call('OpsiHazard1Leveling') self.config.task_call('OpsiHazard1Leveling')
else: else:
logger.info('Just less than 1 day to OpSi reset, delay 2.5 hours') logger.info('Just less than 1 day to OpSi reset, delay 2.5 hours')

View File

@@ -434,7 +434,7 @@ class OSMap(OSFleet, Map, GlobeCamera, StrategicSearchHandler):
Keeping enough startup AP to run CL1. Keeping enough startup AP to run CL1.
""" """
if self.is_cl1_enabled and get_os_reset_remain() > 2 \ if self.is_cl1_enabled and get_os_reset_remain() > 2 \
and self.get_yellow_coins() > self.config.OS_CL1_YELLOW_COINS_PRESERVE: and self.get_yellow_coins() > self.yellow_coins_preserve:
logger.info('Keep 1000 AP when CL1 available') logger.info('Keep 1000 AP when CL1 available')
if not self.action_point_check(1000): if not self.action_point_check(1000):
self.config.opsi_task_delay(cl1_preserve=True) self.config.opsi_task_delay(cl1_preserve=True)

View File

@@ -22,8 +22,8 @@ class OpsiHazard1Leveling(OSMap):
self.config.OS_ACTION_POINT_PRESERVE = 0 self.config.OS_ACTION_POINT_PRESERVE = 0
logger.attr('OS_ACTION_POINT_PRESERVE', self.config.OS_ACTION_POINT_PRESERVE) logger.attr('OS_ACTION_POINT_PRESERVE', self.config.OS_ACTION_POINT_PRESERVE)
if self.get_yellow_coins() < self.config.OS_CL1_YELLOW_COINS_PRESERVE: if self.get_yellow_coins() < self.yellow_coins_preserve:
logger.info(f'Reach the limit of yellow coins, preserve={self.config.OS_CL1_YELLOW_COINS_PRESERVE}') logger.info(f'Reach the limit of yellow coins, preserve={self.yellow_coins_preserve}')
with self.config.multi_set(): with self.config.multi_set():
self.config.task_delay(server_update=True) self.config.task_delay(server_update=True)
if not self.is_in_opsi_explore(): if not self.is_in_opsi_explore():

View File

@@ -52,7 +52,7 @@ class OpsiMeowfficerFarming(OSMap):
# When not running CL1 and use oil # When not running CL1 and use oil
keep_current_ap = True keep_current_ap = True
check_rest_ap = True check_rest_ap = True
if self.is_cl1_enabled and self.get_yellow_coins() >= self.config.OS_CL1_YELLOW_COINS_PRESERVE: if self.is_cl1_enabled and self.get_yellow_coins() >= self.yellow_coins_preserve:
check_rest_ap = False check_rest_ap = False
if not self.is_cl1_enabled and self.config.OpsiGeneral_BuyActionPointLimit > 0: if not self.is_cl1_enabled and self.config.OpsiGeneral_BuyActionPointLimit > 0:
keep_current_ap = False keep_current_ap = False

View File

@@ -1,6 +1,7 @@
import typing as t import typing as t
from datetime import datetime, timedelta from datetime import datetime, timedelta
from module.base.decorator import cached_property
import module.config.server as server import module.config.server as server
from module.base.timer import Timer from module.base.timer import Timer
from module.config.config import Function from module.config.config import Function
@@ -60,6 +61,13 @@ class OSStatus(UI):
tasks = SelectedGrids(self.config.pending_task + self.config.waiting_task).filter(func).sort('next_run') tasks = SelectedGrids(self.config.pending_task + self.config.waiting_task).filter(func).sort('next_run')
return tasks.first_or_none() return tasks.first_or_none()
@cached_property
def yellow_coins_preserve(self):
if self.is_cl1_enabled:
return 100000
else:
return 35000
def get_yellow_coins(self) -> int: def get_yellow_coins(self) -> int:
yellow_coins = 0 yellow_coins = 0
timeout = Timer(2, count=3).start() timeout = Timer(2, count=3).start()

View File

@@ -1,4 +1,3 @@
from module.base.decorator import cached_property
from module.base.timer import Timer from module.base.timer import Timer
from module.combat.assets import GET_ITEMS_1 from module.combat.assets import GET_ITEMS_1
from module.config.utils import get_os_reset_remain from module.config.utils import get_os_reset_remain
@@ -265,13 +264,6 @@ class OSShop(PortShop, AkashiShop):
self.os_shop_buy(select_func=self.os_shop_get_item_to_buy_in_akashi) self.os_shop_buy(select_func=self.os_shop_get_item_to_buy_in_akashi)
self.ui_back(appear_button=PORT_SUPPLY_CHECK, check_button=self.is_in_map, skip_first_screenshot=True) self.ui_back(appear_button=PORT_SUPPLY_CHECK, check_button=self.is_in_map, skip_first_screenshot=True)
@cached_property
def yellow_coins_preserve(self):
if self.is_cl1_enabled:
return 100000
else:
return 35000
def get_currency_coins(self, item): def get_currency_coins(self, item):
if item.cost == 'YellowCoins': if item.cost == 'YellowCoins':
if get_os_reset_remain() == 0: if get_os_reset_remain() == 0: