Add(voucher): 支持自动购买战役信息记录仪以及隐秘海域信息记录仪功能(HiddenZoneDataLogger)

This commit is contained in:
W1NDes 2025-07-11 00:11:35 +08:00
parent a033e6737c
commit 1da50832ee
13 changed files with 98 additions and 5 deletions

View File

@ -1930,6 +1930,7 @@
"ServerUpdate": "00:00"
},
"OpsiShop": {
"BuySpecialRadar": false,
"PresetFilter": "max_benefit_meta",
"CustomFilter": "LoggerAbyssalT6 > LoggerAbyssalT5 > LoggerObscure > LoggerAbyssalT4 > ActionPoint > PurpleCoins\n> GearDesignPlanT3 > PlateRandomT4 > DevelopmentMaterialT3 > GearDesignPlanT2 > GearPart\n> OrdnanceTestingReportT3 > OrdnanceTestingReportT2 > DevelopmentMaterialT2 > OrdnanceTestingReportT1\n> METARedBook > CrystallizedHeatResistantSteel > NanoceramicAlloy > NeuroplasticProstheticArm > SupercavitationGenerator"
},

View File

@ -5,6 +5,7 @@ from module.os.map_operation import OSMapOperation
from module.os.operation_siren import OperationSiren
from module.os_handler.action_point import ActionPointLimit
from module.oilkeep.oilkeep import Oilkeep
class OSCampaignRun(OSMapOperation):
campaign: OperationSiren
@ -29,6 +30,12 @@ class OSCampaignRun(OSMapOperation):
self.config.opsi_task_delay(ap_limit=True)
def opsi_shop(self):
if self.config.OpsiShop_BuySpecialRadar:
if Oilkeep(self.config, self.device).update_oil() > 6000:
self.load_campaign()
self.campaign.os_voucher_buy_loggerUnlock()
else:
logger.warning('oil < 6000, skip buying loggerUnlock')
try:
self.load_campaign()
self.campaign.os_shop()

View File

@ -3552,12 +3552,12 @@
],
"option_bold": [
"event_20230525_cn",
"event_20250520_cn"
"event_20250424_cn"
],
"cn": "event_20230525_cn",
"en": "event_20230525_cn",
"jp": "event_20230525_cn",
"tw": "event_20250520_cn"
"tw": "event_20250424_cn"
},
"Mode": {
"type": "select",
@ -9792,6 +9792,10 @@
}
},
"OpsiShop": {
"BuySpecialRadar": {
"type": "checkbox",
"value": false
},
"PresetFilter": {
"type": "select",
"value": "max_benefit_meta",

View File

@ -802,6 +802,7 @@ OpsiExplore:
ForceRun: false
LastZone: 0
OpsiShop:
BuySpecialRadar: false
PresetFilter:
value: max_benefit_meta
option:

View File

@ -496,6 +496,7 @@ class GeneratedConfig:
OpsiExplore_LastZone = 0
# Group `OpsiShop`
OpsiShop_BuySpecialRadar = False
OpsiShop_PresetFilter = 'max_benefit_meta' # max_benefit, max_benefit_meta, no_meta, all, custom
OpsiShop_CustomFilter = 'LoggerAbyssalT6 > LoggerAbyssalT5 > LoggerObscure > LoggerAbyssalT4 > ActionPoint > PurpleCoins\n> GearDesignPlanT3 > PlateRandomT4 > DevelopmentMaterialT3 > GearDesignPlanT2 > GearPart\n> OrdnanceTestingReportT3 > OrdnanceTestingReportT2 > DevelopmentMaterialT2 > OrdnanceTestingReportT1\n> METARedBook > CrystallizedHeatResistantSteel > NanoceramicAlloy > NeuroplasticProstheticArm > SupercavitationGenerator'

View File

@ -2755,6 +2755,10 @@
"name": "OpSi Shop Settings",
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story and practice battles must be complete\n- Task OpSi Explore enabled or consuming 5000 oil for special radar in OpSi voucher shop\nAvailable only in the next month after clearing OpSi story, i.e., after the port shop becomes a new version of the shop"
},
"BuySpecialRadar": {
"name": "Buy Special Radar",
"help": "Automatically purchase the Operation Siren Data Logger (5k oil item)"
},
"PresetFilter": {
"name": "OpSi Shop Filter",
"help": "Generally does not need to be modified. Use \"High value items and META material\"` if Voucher Coins spilled or \"Without META materials\" if you are newcomer.\nHigh value items include ActionPoint, Logger and T4 or higher items; META materials include METABook and META enhance materials.",

View File

@ -2755,6 +2755,10 @@
"name": "OpsiShop._info.name",
"help": "OpsiShop._info.help"
},
"BuySpecialRadar": {
"name": "戦闘情報記録器購入",
"help": "戦闘情報記録器5000油道具自動購入"
},
"PresetFilter": {
"name": "OpsiShop.PresetFilter.name",
"help": "OpsiShop.PresetFilter.help",

View File

@ -2755,6 +2755,10 @@
"name": "大世界商店",
"help": "使用此功能前必须满足以下条件:\n- 通关大世界主线并完成模拟战+塞壬试验场\n- 启用大世界开荒任务或使用战役信息记录仪5000油道具\n- 通关大世界主线后的下一个月,即港口商店变为新版商店后才可使用"
},
"BuySpecialRadar": {
"name": "购买战役信息记录仪",
"help": "自动购买战役信息记录仪5000油道具"
},
"PresetFilter": {
"name": "港口商店过滤器",
"help": "一般默认即可,白票溢出建议选 \"高价值物品与META材料\",萌新建议选 \"不购买META材料\"这会买除了META材料以外的所有东西。\n高价值物品为行动力、坐标和金或者更高级別的商品META材料为META通用战术教材和4种强化材料。",

View File

@ -2755,6 +2755,10 @@
"name": "大世界商店",
"help": "使用此功能前必須滿足以下條件:\n- 通關大世界主線任務+模擬戰\n- 開啟大世界開荒任務或使用戰役信息記錄儀5000油道具\n- 通關大世界主線後的下個月,也就是港口商店變成新版商店後才可使用"
},
"BuySpecialRadar": {
"name": "購買戰役信息記錄儀",
"help": "自動購買戰役信息記錄儀5000油道具"
},
"PresetFilter": {
"name": "港口商店過濾器",
"help": "一般用預設即可,白票溢出建議選 \"高價值物品與META材料\",新手建議選 \"不購買META材料\"這會買除了META材料以外的所有東西。\n高價值物品為行動點、坐標和金或者更高級別的物品META材料為META通用戰術教材和4種強化材料。",

View File

@ -262,6 +262,12 @@ class OperationSiren(OSMap):
self.config.task_delay(target=next_reset)
self.config.task_stop()
def os_voucher_buy_loggerUnlock(self):
logger.hr('OS voucher buy loggerUnlock', level=1)
self._os_voucher_enter()
VoucherShop(self.config, self.device).run_loggerUnlock()
self._os_voucher_exit()
def _os_shop_delay(self, not_empty) -> datetime:
"""
Calculate the delay of OpsiShop.

View File

@ -16,7 +16,7 @@ FILTER_REGEX = re.compile(
'^(array|book|box|bulin|cat'
'|chip|coin|cube|drill|food'
'|plate|retrofit|pr|dr|specializedcore'
'|logger|tuning'
'|logger|tuning|hiddenzonedatalogger'
'|hecombatplan|fragment'
'|albacore|bataan|bearn|bluegill|carabiniere|casablanca|contedicavour|dukeofyork'
'|echo|eldridge|gangut|glorious|grenville|hibiki|hunter|icarus'
@ -208,7 +208,7 @@ class ShopBase(UI):
return False
def shop_get_items(self, skip_first_screenshot=True):
def shop_get_items(self, skip_first_screenshot=True,cost=True):
"""
Args:
skip_first_screenshot (bool):
@ -248,7 +248,7 @@ class ShopBase(UI):
self.device.image,
name=True,
amount=False,
cost=True,
cost=cost,
price=True,
tag=False
)

View File

@ -344,3 +344,34 @@ class ShopClerk(ShopBase, Retirement):
logger.warning('Too many items to buy, stopped')
return True
def shop_buy_loggerUnlock(self):
"""
Returns:
bool: If success, and able to continue.
"""
for _ in range(12):
logger.hr('Shop buy loggerUnlock', level=2)
# Get first for innate delay to ocr
# shop currency for accurate parse
items = self.shop_get_items(cost=False)
self.shop_currency()
if self._currency <= 0:
logger.warning(f'Current funds: {self._currency}, stopped')
return False
if items is None:
logger.info('Shop buy finished')
return True
for item in items:
if item.price == 5000:
logger.warning(f'Found loggerUnlock, buy it')
self.shop_buy_execute(item)
return True
else:
continue
logger.warning('no loggerUnlock to buy, stopped')
return True

View File

@ -209,6 +209,32 @@ class VoucherShop(ShopClerk, ShopStatus):
del_cached_property(self, 'shop_voucher_items')
continue
def run_loggerUnlock(self):
"""
Run Voucher Shop
"""
# Base case; exit run if filter empty
if not self.shop_filter:
return
# When called, expected to be in
# correct Voucher Shop interface
logger.hr('Voucher Shop', level=1)
self.wait_until_voucher_appear()
# Execute buy operations
VOUCHER_SHOP_SCROLL.set_top(main=self)
while 1:
self.shop_buy_loggerUnlock()
if VOUCHER_SHOP_SCROLL.at_bottom(main=self):
logger.info('Voucher Shop reach bottom, stop')
break
else:
VOUCHER_SHOP_SCROLL.next_page(main=self)
del_cached_property(self, 'shop_grid')
del_cached_property(self, 'shop_voucher_items')
continue
def run_once(self):
"""
Run Voucher Shop to purchase