Skip to content

Commit 151c8e5

Browse files
committed
Add: check leveling in cl1 daily
1 parent 3b65dfe commit 151c8e5

File tree

18 files changed

+397
-0
lines changed

18 files changed

+397
-0
lines changed

assets/cn/awaken/OCR_SHIP_EXP.png

2.75 KB
Loading

assets/cn/os/FLEET_FLAGSHIP.png

2.84 KB
Loading

config/template.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,10 @@
18501850
"Fleet": 1,
18511851
"Submarine": false
18521852
},
1853+
"OpsiCheckLeveling": {
1854+
"TargetLevel": 0,
1855+
"LastRun": "2020-01-01 00:00:00"
1856+
},
18531857
"Storage": {
18541858
"Storage": {}
18551859
}
@@ -1870,6 +1874,10 @@
18701874
"Fleet": 1,
18711875
"Submarine": false
18721876
},
1877+
"OpsiCheckLeveling": {
1878+
"TargetLevel": 0,
1879+
"LastRun": "2020-01-01 00:00:00"
1880+
},
18731881
"Storage": {
18741882
"Storage": {}
18751883
}

dev_tools/ship_exp_extract.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from dev_tools.utils import LuaLoader
2+
3+
4+
class ShipEXP:
5+
def __init__(self):
6+
self.ship_exp = [0] * 125 # Initialize a list for levels 0 to 125
7+
data = LOADER.load('sharecfg/ship_level.lua')
8+
total_exp = 0
9+
for index, exp in data.items():
10+
if not isinstance(index, int) or index >= 124:
11+
continue
12+
total_exp += exp['exp']
13+
self.ship_exp[exp['level']] = total_exp
14+
15+
def encode(self):
16+
lines = []
17+
lines.append('# This file is auto-generated by dev_tools/ship_exp_extract.py.')
18+
lines.append('# Do not edit this file manually.')
19+
lines.append('')
20+
lines.append('LIST_SHIP_EXP = [')
21+
for exp in self.ship_exp:
22+
lines.append(f' {exp},')
23+
lines.append(']')
24+
return lines
25+
26+
def write(self, file):
27+
print(f'writing {file}')
28+
with open(file, 'w', encoding='utf-8') as f:
29+
for text in self.encode():
30+
f.write(text + '\n')
31+
32+
33+
"""
34+
This is an auto-tool to extract accumulative ship leveling exp for operation siren leveling check.
35+
36+
Git clone https://github.com/AzurLaneTools/AzurLaneLuaScripts, to get the decrypted scripts.
37+
Arguments:
38+
FILE: Path to repository, such as 'xxx/AzurLaneLuaScripts'
39+
SAVE: File to save, 'module/os/ship_exp.py'
40+
"""
41+
FOLDER = '../AzurLaneLuaScripts/'
42+
SAVE = 'module/os/ship_exp_data.py'
43+
44+
LOADER = LuaLoader(FOLDER)
45+
ShipEXP().write(SAVE)

module/awaken/assets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
COST_CHIP = Button(area={'cn': (610, 375, 670, 435), 'en': (610, 375, 670, 435), 'jp': (610, 375, 670, 435), 'tw': (610, 375, 670, 435)}, color={'cn': (157, 188, 190), 'en': (157, 188, 190), 'jp': (157, 188, 190), 'tw': (157, 188, 190)}, button={'cn': (610, 375, 670, 435), 'en': (610, 375, 670, 435), 'jp': (610, 375, 670, 435), 'tw': (610, 375, 670, 435)}, file={'cn': './assets/cn/awaken/COST_CHIP.png', 'en': './assets/cn/awaken/COST_CHIP.png', 'jp': './assets/cn/awaken/COST_CHIP.png', 'tw': './assets/cn/awaken/COST_CHIP.png'})
1313
COST_COIN = Button(area={'cn': (499, 373, 559, 433), 'en': (499, 373, 559, 433), 'jp': (499, 373, 559, 433), 'tw': (499, 373, 559, 433)}, color={'cn': (219, 180, 83), 'en': (219, 180, 83), 'jp': (219, 180, 83), 'tw': (219, 180, 83)}, button={'cn': (499, 373, 559, 433), 'en': (499, 373, 559, 433), 'jp': (499, 373, 559, 433), 'tw': (499, 373, 559, 433)}, file={'cn': './assets/cn/awaken/COST_COIN.png', 'en': './assets/cn/awaken/COST_COIN.png', 'jp': './assets/cn/awaken/COST_COIN.png', 'tw': './assets/cn/awaken/COST_COIN.png'})
1414
LEVEL_UP = Button(area={'cn': (804, 282, 897, 304), 'en': (864, 286, 910, 302), 'jp': (807, 284, 893, 303), 'tw': (805, 282, 893, 304)}, color={'cn': (141, 167, 216), 'en': (130, 158, 213), 'jp': (141, 171, 208), 'tw': (147, 179, 219)}, button={'cn': (804, 282, 897, 304), 'en': (864, 286, 910, 302), 'jp': (807, 284, 893, 303), 'tw': (805, 282, 893, 304)}, file={'cn': './assets/cn/awaken/LEVEL_UP.png', 'en': './assets/en/awaken/LEVEL_UP.png', 'jp': './assets/jp/awaken/LEVEL_UP.png', 'tw': './assets/tw/awaken/LEVEL_UP.png'})
15+
OCR_SHIP_EXP = Button(area={'cn': (1102, 276, 1250, 306), 'en': (1102, 276, 1250, 306), 'jp': (1102, 276, 1250, 306), 'tw': (1102, 276, 1250, 306)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255), 'tw': (255, 255, 255)}, button={'cn': (1102, 276, 1250, 306), 'en': (1102, 276, 1250, 306), 'jp': (1102, 276, 1250, 306), 'tw': (1102, 276, 1250, 306)}, file={'cn': './assets/cn/awaken/OCR_SHIP_EXP.png', 'en': './assets/cn/awaken/OCR_SHIP_EXP.png', 'jp': './assets/cn/awaken/OCR_SHIP_EXP.png', 'tw': './assets/cn/awaken/OCR_SHIP_EXP.png'})
1516
OCR_SHIP_LEVEL = Button(area={'cn': (757, 283, 799, 319), 'en': (757, 283, 799, 319), 'jp': (746, 279, 798, 317), 'tw': (757, 283, 799, 319)}, color={'cn': (115, 130, 142), 'en': (115, 130, 142), 'jp': (122, 116, 116), 'tw': (115, 130, 142)}, button={'cn': (757, 283, 799, 319), 'en': (757, 283, 799, 319), 'jp': (746, 279, 798, 317), 'tw': (757, 283, 799, 319)}, file={'cn': './assets/cn/awaken/OCR_SHIP_LEVEL.png', 'en': './assets/cn/awaken/OCR_SHIP_LEVEL.png', 'jp': './assets/jp/awaken/OCR_SHIP_LEVEL.png', 'tw': './assets/cn/awaken/OCR_SHIP_LEVEL.png'})
1617
SHIP_LEVEL_CHECK = Button(area={'cn': (706, 298, 742, 315), 'en': (706, 298, 742, 315), 'jp': (703, 293, 734, 314), 'tw': (706, 298, 742, 315)}, color={'cn': (171, 162, 193), 'en': (171, 162, 193), 'jp': (125, 119, 116), 'tw': (171, 162, 193)}, button={'cn': (706, 298, 742, 315), 'en': (706, 298, 742, 315), 'jp': (703, 293, 734, 314), 'tw': (706, 298, 742, 315)}, file={'cn': './assets/cn/awaken/SHIP_LEVEL_CHECK.png', 'en': './assets/cn/awaken/SHIP_LEVEL_CHECK.png', 'jp': './assets/jp/awaken/SHIP_LEVEL_CHECK.png', 'tw': './assets/cn/awaken/SHIP_LEVEL_CHECK.png'})

module/campaign/os_run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def opsi_daily(self):
5252
def opsi_meowfficer_farming(self):
5353
try:
5454
self.load_campaign()
55+
self.campaign.os_check_leveling()
5556
self.campaign.os_meowfficer_farming()
5657
except ActionPointLimit:
5758
if get_os_reset_remain() > 0:
@@ -64,6 +65,7 @@ def opsi_meowfficer_farming(self):
6465
def opsi_hazard1_leveling(self):
6566
try:
6667
self.load_campaign()
68+
self.campaign.os_check_leveling()
6769
self.campaign.os_hazard1_leveling()
6870
except ActionPointLimit:
6971
self.config.task_delay(server_update=True)

module/config/argument/args.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9311,6 +9311,17 @@
93119311
"value": false
93129312
}
93139313
},
9314+
"OpsiCheckLeveling": {
9315+
"TargetLevel": {
9316+
"type": "input",
9317+
"value": 0
9318+
},
9319+
"LastRun": {
9320+
"type": "datetime",
9321+
"value": "2020-01-01 00:00:00",
9322+
"validate": "datetime"
9323+
}
9324+
},
93149325
"Storage": {
93159326
"Storage": {
93169327
"type": "storage",
@@ -9384,6 +9395,17 @@
93849395
"display": "hide"
93859396
}
93869397
},
9398+
"OpsiCheckLeveling": {
9399+
"TargetLevel": {
9400+
"type": "input",
9401+
"value": 0
9402+
},
9403+
"LastRun": {
9404+
"type": "datetime",
9405+
"value": "2020-01-01 00:00:00",
9406+
"validate": "datetime"
9407+
}
9408+
},
93879409
"Storage": {
93889410
"Storage": {
93899411
"type": "storage",

module/config/argument/argument.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,9 @@ OpsiHazard1Leveling:
722722
TargetZone:
723723
value: 0
724724
option: [ 0, 44, 22 ]
725+
OpsiCheckLeveling:
726+
TargetLevel: 0
727+
LastRun: 2020-01-01 00:00:00
725728

726729
# ==================== Tools ====================
727730

module/config/argument/task.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,12 @@ Opsi:
315315
- Scheduler
316316
- OpsiMeowfficerFarming
317317
- OpsiFleet
318+
- OpsiCheckLeveling
318319
OpsiHazard1Leveling:
319320
- Scheduler
320321
- OpsiHazard1Leveling
321322
- OpsiFleet
323+
- OpsiCheckLeveling
322324
OpsiCrossMonth:
323325
- Scheduler
324326

module/config/config_generated.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ class GeneratedConfig:
429429
# Group `OpsiHazard1Leveling`
430430
OpsiHazard1Leveling_TargetZone = 0 # 0, 44, 22
431431

432+
# Group `OpsiCheckLeveling`
433+
OpsiCheckLeveling_TargetLevel = 0
434+
OpsiCheckLeveling_LastRun = datetime.datetime(2020, 1, 1, 0, 0)
435+
432436
# Group `Daemon`
433437
Daemon_EnterMap = True
434438

0 commit comments

Comments
 (0)