Skip to content

Commit 63cf17b

Browse files
committed
Add: check leveling in cl1/meowfficerfarming daily
1 parent 75af8e3 commit 63cf17b

19 files changed

Lines changed: 448 additions & 0 deletions

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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,11 @@
18691869
"Fleet": 1,
18701870
"Submarine": false
18711871
},
1872+
"OpsiCheckLeveling": {
1873+
"TargetLevel": 0,
1874+
"LastRun": "2020-01-01 00:00:00",
1875+
"DelayAfterFull": false
1876+
},
18721877
"Storage": {
18731878
"Storage": {}
18741879
}
@@ -1889,6 +1894,11 @@
18891894
"Fleet": 1,
18901895
"Submarine": false
18911896
},
1897+
"OpsiCheckLeveling": {
1898+
"TargetLevel": 0,
1899+
"LastRun": "2020-01-01 00:00:00",
1900+
"DelayAfterFull": false
1901+
},
18921902
"Storage": {
18931903
"Storage": {}
18941904
}

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
@@ -44,6 +44,7 @@ def opsi_daily(self):
4444
def opsi_meowfficer_farming(self):
4545
try:
4646
campaign = self.load_campaign()
47+
campaign.os_check_leveling()
4748
campaign.os_meowfficer_farming()
4849
except ActionPointLimit:
4950
if get_os_reset_remain() > 0:
@@ -59,6 +60,7 @@ def opsi_meowfficer_farming(self):
5960
def opsi_hazard1_leveling(self):
6061
try:
6162
campaign = self.load_campaign()
63+
campaign.os_check_leveling()
6264
campaign.os_hazard1_leveling()
6365
except ActionPointLimit:
6466
self.config.task_delay(server_update=True)

module/config/argument/args.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9063,6 +9063,21 @@
90639063
"value": false
90649064
}
90659065
},
9066+
"OpsiCheckLeveling": {
9067+
"TargetLevel": {
9068+
"type": "input",
9069+
"value": 0
9070+
},
9071+
"LastRun": {
9072+
"type": "datetime",
9073+
"value": "2020-01-01 00:00:00",
9074+
"validate": "datetime"
9075+
},
9076+
"DelayAfterFull": {
9077+
"type": "checkbox",
9078+
"value": false
9079+
}
9080+
},
90669081
"Storage": {
90679082
"Storage": {
90689083
"type": "storage",
@@ -9136,6 +9151,21 @@
91369151
"display": "hide"
91379152
}
91389153
},
9154+
"OpsiCheckLeveling": {
9155+
"TargetLevel": {
9156+
"type": "input",
9157+
"value": 0
9158+
},
9159+
"LastRun": {
9160+
"type": "datetime",
9161+
"value": "2020-01-01 00:00:00",
9162+
"validate": "datetime"
9163+
},
9164+
"DelayAfterFull": {
9165+
"type": "checkbox",
9166+
"value": false
9167+
}
9168+
},
91399169
"Storage": {
91409170
"Storage": {
91419171
"type": "storage",

module/config/argument/argument.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,10 @@ OpsiHazard1Leveling:
731731
TargetZone:
732732
value: 0
733733
option: [ 0, 44, 22 ]
734+
OpsiCheckLeveling:
735+
TargetLevel: 0
736+
LastRun: 2020-01-01 00:00:00
737+
DelayAfterFull: false
734738

735739
# ==================== Tools ====================
736740

module/config/argument/task.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,12 @@ Opsi:
318318
- Scheduler
319319
- OpsiMeowfficerFarming
320320
- OpsiFleet
321+
- OpsiCheckLeveling
321322
OpsiHazard1Leveling:
322323
- Scheduler
323324
- OpsiHazard1Leveling
324325
- OpsiFleet
326+
- OpsiCheckLeveling
325327
OpsiCrossMonth:
326328
- Scheduler
327329

module/config/config_generated.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ class GeneratedConfig:
435435
# Group `OpsiHazard1Leveling`
436436
OpsiHazard1Leveling_TargetZone = 0 # 0, 44, 22
437437

438+
# Group `OpsiCheckLeveling`
439+
OpsiCheckLeveling_TargetLevel = 0
440+
OpsiCheckLeveling_LastRun = datetime.datetime(2020, 1, 1, 0, 0)
441+
OpsiCheckLeveling_DelayAfterFull = False
442+
438443
# Group `Daemon`
439444
Daemon_EnterMap = True
440445

0 commit comments

Comments
 (0)