Add: Opsi archive zone monthly task support

This commit is contained in:
nEEtdo0d 2022-11-27 23:04:25 -05:00
parent 186aca2ea5
commit afc8468e0a
16 changed files with 226 additions and 12 deletions

View File

@ -304,6 +304,10 @@ class AzurLaneAutoScript:
from module.campaign.os_run import OSCampaignRun
OSCampaignRun(config=self.config, device=self.device).opsi_abyssal()
def opsi_archive(self):
from module.campaign.os_run import OSCampaignRun
OSCampaignRun(config=self.config, device=self.device).opsi_archive()
def opsi_stronghold(self):
from module.campaign.os_run import OSCampaignRun
OSCampaignRun(config=self.config, device=self.device).opsi_stronghold()

View File

@ -1572,6 +1572,23 @@
"Filter": "Fleet-4 > CallSubmarine > Fleet-2 > Fleet-3 > Fleet-1"
}
},
"OpsiArchive": {
"Scheduler": {
"Enable": false,
"NextRun": "2020-01-01 00:00:00",
"Command": "OpsiArchive",
"SuccessInterval": 60,
"FailureInterval": 60,
"ServerUpdate": "00:00"
},
"OpsiArchive": {
"Unused": false
},
"OpsiFleet": {
"Fleet": 1,
"Submarine": false
}
},
"OpsiStronghold": {
"Scheduler": {
"Enable": false,

View File

@ -75,6 +75,13 @@ class OSCampaignRun(OSMapOperation):
except ActionPointLimit:
self.config.opsi_task_delay(ap_limit=True)
def opsi_archive(self):
self.load_campaign()
try:
self.campaign.os_archive()
except ActionPointLimit:
self.config.opsi_task_delay(ap_limit=True)
def opsi_stronghold(self):
self.load_campaign()
try:

View File

@ -7630,6 +7630,45 @@
}
}
},
"OpsiVoucher": {
"Scheduler": {
"Enable": {
"type": "checkbox",
"value": false
},
"NextRun": {
"type": "datetime",
"value": "2020-01-01 00:00:00",
"validate": "datetime"
},
"Command": {
"type": "input",
"value": "OpsiVoucher",
"display": "hide"
},
"SuccessInterval": {
"type": "input",
"value": 0,
"display": "hide"
},
"FailureInterval": {
"type": "input",
"value": 0,
"display": "hide"
},
"ServerUpdate": {
"type": "input",
"value": "00:00",
"display": "hide"
}
},
"OpsiVoucher": {
"Filter": {
"type": "textarea",
"value": "LoggerAbyssal > LoggerObscure > HECombatPlan > Book > Coin"
}
}
},
"OpsiDaily": {
"Scheduler": {
"Enable": {
@ -7789,6 +7828,61 @@
}
}
},
"OpsiArchive": {
"Scheduler": {
"Enable": {
"type": "checkbox",
"value": false
},
"NextRun": {
"type": "datetime",
"value": "2020-01-01 00:00:00",
"validate": "datetime"
},
"Command": {
"type": "input",
"value": "OpsiArchive",
"display": "hide"
},
"SuccessInterval": {
"type": "input",
"value": 60,
"display": "hide"
},
"FailureInterval": {
"type": "input",
"value": 60,
"display": "hide"
},
"ServerUpdate": {
"type": "input",
"value": "00:00",
"display": "hide"
}
},
"OpsiArchive": {
"Unused": {
"type": "checkbox",
"value": false
}
},
"OpsiFleet": {
"Fleet": {
"type": "select",
"value": 1,
"option": [
1,
2,
3,
4
]
},
"Submarine": {
"type": "checkbox",
"value": false
}
}
},
"OpsiStronghold": {
"Scheduler": {
"Enable": {

View File

@ -569,6 +569,8 @@ OpsiObscure:
ForceRun: false
OpsiAbyssal:
ForceRun: false
OpsiArchive:
Unused: false
OpsiStronghold:
ForceRun: false
OpsiMeowfficerFarming:

View File

@ -57,6 +57,7 @@
"OpsiDaily",
"OpsiObscure",
"OpsiAbyssal",
"OpsiArchive",
"OpsiStronghold",
"OpsiMeowfficerFarming"
],

View File

@ -356,6 +356,11 @@ OpsiAbyssal:
SuccessInterval: 60
FailureInterval: 60
ServerUpdate: 00:00
OpsiArchive:
Scheduler:
SuccessInterval: 60
FailureInterval: 60
ServerUpdate: 00:00
OpsiStronghold:
Scheduler:
SuccessInterval: 60

View File

@ -258,6 +258,10 @@ OpsiAbyssal:
- Scheduler
- OpsiAbyssal
- OpsiFleetFilter
OpsiArchive:
- Scheduler
- OpsiArchive
- OpsiFleet
OpsiStronghold:
- Scheduler
- OpsiStronghold

View File

@ -490,6 +490,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
"OpsiDaily",
"OpsiObscure",
"OpsiAbyssal",
"OpsiArchive",
"OpsiStronghold",
"OpsiMeowfficerFarming",
]

View File

@ -378,6 +378,9 @@ class GeneratedConfig:
# Group `OpsiAbyssal`
OpsiAbyssal_ForceRun = False
# Group `OpsiArchive`
OpsiArchive_Unused = False
# Group `OpsiStronghold`
OpsiStronghold_ForceRun = False

View File

@ -18,7 +18,7 @@ class ManualConfig:
> OpsiExplore
> OpsiAshBeacon
> OpsiDaily > OpsiShop > OpsiVoucher
> OpsiAbyssal > OpsiStronghold > OpsiObscure
> OpsiAbyssal > OpsiStronghold > OpsiObscure > OpsiArchive
> Daily > Hard > OpsiAshBeacon > OpsiAshAssist
> Sos > EventSp > EventA > EventB > EventC > EventD > RaidDaily > WarArchives > MaritimeEscort
> Event > Event2 > Raid > Main > Main2 > Main3

View File

@ -214,6 +214,10 @@
"name": "Abyssal Zones",
"help": ""
},
"OpsiArchive": {
"name": "Archive Zones",
"help": ""
},
"OpsiStronghold": {
"name": "Siren Strongholds",
"help": ""
@ -2092,7 +2096,17 @@
},
"ForceRun": {
"name": "Force Run",
"help": "Ignore interval, clear all obscure zones, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
"help": "Ignore interval, clear all abyssal zones, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
}
},
"OpsiArchive": {
"_info": {
"name": "Archive Zones",
"help": "Clear archive zones.\nThe following must be satisfied:\n- OpSi story must be complete\n- Zones must be unlocked either by OpSi explore or consuming 5000 oil for special radar in OpSi Exchange shop"
},
"Unused": {
"name": "Unused",
"help": "Archive zones are AP free\nThis only exists in order to display the prerequisites for this task"
}
},
"OpsiStronghold": {
@ -2102,7 +2116,7 @@
},
"ForceRun": {
"name": "Force Run",
"help": "Ignore interval, clear all obscure zones, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
"help": "Ignore interval, clear all siren strongholds, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
}
},
"OpsiMeowfficerFarming": {

View File

@ -214,6 +214,10 @@
"name": "Task.OpsiAbyssal.name",
"help": "Task.OpsiAbyssal.help"
},
"OpsiArchive": {
"name": "Task.OpsiArchive.name",
"help": "Task.OpsiArchive.help"
},
"OpsiStronghold": {
"name": "Task.OpsiStronghold.name",
"help": "Task.OpsiStronghold.help"
@ -589,7 +593,7 @@
"name": "Campaign.Event.name",
"help": "Campaign.Event.help",
"campaign_main": "campaign_main",
"event_20221110_cn": "虚畳なりし限象(復刻)",
"event_20201229_cn": "虚畳なりし限象(復刻)",
"event_20211111_cn": "燈火のシニエ",
"raid_20221027": "戦えロイヤルメイド隊3rd",
"event_20210121_cn": "悲歎せし焔海の詩(復刻)",
@ -619,7 +623,6 @@
"event_20210225_cn": "暁射す氷華の嵐",
"event_20220210_cn": "凍絶の北海(復刻)",
"raid_20220127": "秘密事件調査",
"event_20201229_cn": "虚畳なりし限象",
"event_20211229_cn": "遡望せし虹彩の塔",
"event_20211125_cn": "弧光は交わる世界にて",
"event_20211028_tw": "復刻光與影的鳶尾之華",
@ -2096,6 +2099,16 @@
"help": "OpsiAbyssal.ForceRun.help"
}
},
"OpsiArchive": {
"_info": {
"name": "OpsiArchive._info.name",
"help": "OpsiArchive._info.help"
},
"Unused": {
"name": "OpsiArchive.Unused.name",
"help": "OpsiArchive.Unused.help"
}
},
"OpsiStronghold": {
"_info": {
"name": "OpsiStronghold._info.name",

View File

@ -214,6 +214,10 @@
"name": "深渊海域",
"help": ""
},
"OpsiArchive": {
"name": "Task.OpsiArchive.name",
"help": "Task.OpsiArchive.help"
},
"OpsiStronghold": {
"name": "塞壬要塞",
"help": ""
@ -589,7 +593,7 @@
"name": "活动名称",
"help": "自动选择至最新的活动",
"campaign_main": "主线图",
"event_20221110_cn": "复刻负象限作战",
"event_20201229_cn": "复刻负象限作战",
"event_20211111_cn": "杰诺瓦的焰火",
"raid_20221027": "战斗皇家女仆队3rd",
"event_20210121_cn": "复刻神圣的悲喜剧",
@ -619,7 +623,6 @@
"event_20210225_cn": "破晓冰华",
"event_20220210_cn": "复刻北境序曲",
"raid_20220127": "演习神秘事件调查",
"event_20201229_cn": "负象限作战",
"event_20211229_cn": "逆转彩虹之塔",
"event_20211125_cn": "交汇世界的弧光",
"event_20211028_tw": "復刻光與影的鳶尾之華",
@ -2096,6 +2099,16 @@
"help": "开启后将带来额外的行动力消耗,一般不用打开,慢慢打就好"
}
},
"OpsiArchive": {
"_info": {
"name": "OpsiArchive._info.name",
"help": "OpsiArchive._info.help"
},
"Unused": {
"name": "OpsiArchive.Unused.name",
"help": "OpsiArchive.Unused.help"
}
},
"OpsiStronghold": {
"_info": {
"name": "塞壬要塞",

View File

@ -214,6 +214,10 @@
"name": "深淵海域",
"help": ""
},
"OpsiArchive": {
"name": "Task.OpsiArchive.name",
"help": "Task.OpsiArchive.help"
},
"OpsiStronghold": {
"name": "塞壬要塞",
"help": ""
@ -589,7 +593,7 @@
"name": "活動名稱",
"help": "自動選擇至最新的活動圖",
"campaign_main": "主線圖",
"event_20221110_cn": "Inverted Orthant Rerun",
"event_20201229_cn": "Inverted Orthant Rerun",
"event_20211111_cn": "杰諾瓦的焰火",
"raid_20221027": "Fight On Royal Maids!(Part 3)",
"event_20210121_cn": "復刻神聖的悲喜劇",
@ -619,7 +623,6 @@
"event_20210225_cn": "破曉冰華",
"event_20220210_cn": "Northern Overture Rerun",
"raid_20220127": "Mystery Investigation",
"event_20201229_cn": "負象限作戰",
"event_20211229_cn": "Tower of Transcendence",
"event_20211125_cn": "交匯世界的弧光",
"event_20211028_tw": "復刻光與影的鳶尾之華",
@ -2096,6 +2099,16 @@
"help": "開啟後將帶來額外的行動力消耗,一般不用打開,慢慢打就好"
}
},
"OpsiArchive": {
"_info": {
"name": "OpsiArchive._info.name",
"help": "OpsiArchive._info.help"
},
"Unused": {
"name": "OpsiArchive.Unused.name",
"help": "OpsiArchive.Unused.help"
}
},
"OpsiStronghold": {
"_info": {
"name": "塞壬要塞",

View File

@ -67,11 +67,15 @@ class OperationSiren(OSMap):
self.run_auto_search()
self.handle_after_auto_search()
def os_finish_daily_mission(self):
def os_finish_daily_mission(self, question=True, rescan=None):
"""
Finish all daily mission in Operation Siren.
Suggest to run os_port_daily to accept missions first.
Args:
question (bool): refer to run_auto_search
rescan (None, bool): refer to run_auto_search
Returns:
bool: True if all finished.
"""
@ -91,7 +95,7 @@ class OperationSiren(OSMap):
self.os_order_execute(
recon_scan=False,
submarine_call=self.config.OpsiFleet_Submarine and result != 'pinned_at_archive_zone')
self.run_auto_search()
self.run_auto_search(question, rescan)
self.handle_after_auto_search()
self.config.check_task_switch()
@ -204,7 +208,7 @@ class OperationSiren(OSMap):
logger.info('Delay other OpSi tasks during OpsiExplore')
with self.config.multi_set():
next_run = self.config.Scheduler_NextRun
for task in ['OpsiObscure', 'OpsiAbyssal', 'OpsiStronghold', 'OpsiMeowfficerFarming']:
for task in ['OpsiObscure', 'OpsiAbyssal', 'OpsiArchive', 'OpsiStronghold', 'OpsiMeowfficerFarming']:
keys = f'{task}.Scheduler.NextRun'
current = self.config.cross_get(keys=keys, default=DEFAULT_TIME)
if current < next_run:
@ -373,6 +377,25 @@ class OperationSiren(OSMap):
self.clear_abyssal()
self.config.check_task_switch()
def os_archive(self):
shop = VoucherShop(self.config, self.device)
while 1:
# In case logger bought manually,
# finish pre-existing archive zone
self.os_finish_daily_mission(question=False, rescan=False)
logger.hr('OS voucher', level=1)
self._os_voucher_enter()
bought = shop.run_once()
self._os_voucher_exit()
if not bought:
break
next_reset = get_os_next_reset()
logger.info('All archive zones finished, delay to next reset')
logger.attr('OpsiNextReset', next_reset)
self.config.task_delay(target=next_reset)
def clear_stronghold(self):
"""
Find a siren stronghold on globe map,