mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-29 11:37:13 +08:00
Add: Add Students with Level >= X Only
This commit is contained in:
@@ -1253,7 +1253,8 @@
|
||||
},
|
||||
"AddNewStudent": {
|
||||
"Enable": false,
|
||||
"Favorite": true
|
||||
"Favorite": true,
|
||||
"MinLevel": 50
|
||||
},
|
||||
"Storage": {
|
||||
"Storage": {}
|
||||
|
||||
@@ -6685,6 +6685,10 @@
|
||||
"Favorite": {
|
||||
"type": "checkbox",
|
||||
"value": true
|
||||
},
|
||||
"MinLevel": {
|
||||
"type": "input",
|
||||
"value": 50
|
||||
}
|
||||
},
|
||||
"Storage": {
|
||||
|
||||
@@ -362,6 +362,7 @@ ControlExpOverflow:
|
||||
AddNewStudent:
|
||||
Enable: false
|
||||
Favorite: true
|
||||
MinLevel: 50
|
||||
Research:
|
||||
UseCube:
|
||||
value: only_05_hour
|
||||
|
||||
@@ -1417,6 +1417,10 @@
|
||||
"Favorite": {
|
||||
"name": "Use Favorite Filter",
|
||||
"help": "During student selection apply the favorite filter\nThereby, giving priority to certain ship girls\nApply the favorite status to a ship girl in-game"
|
||||
},
|
||||
"MinLevel": {
|
||||
"name": "Add Students with Level >= X Only",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Research": {
|
||||
|
||||
@@ -1417,6 +1417,10 @@
|
||||
"Favorite": {
|
||||
"name": "好ましい選択",
|
||||
"help": ""
|
||||
},
|
||||
"MinLevel": {
|
||||
"name": "レベルがX以上のキャラクターのみを追加してください。",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Research": {
|
||||
|
||||
@@ -1417,6 +1417,10 @@
|
||||
"Favorite": {
|
||||
"name": "优先选择常用",
|
||||
"help": ""
|
||||
},
|
||||
"MinLevel": {
|
||||
"name": "仅添加等级 >= X 的角色",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Research": {
|
||||
|
||||
@@ -1417,6 +1417,10 @@
|
||||
"Favorite": {
|
||||
"name": "優先選擇常用",
|
||||
"help": ""
|
||||
},
|
||||
"MinLevel": {
|
||||
"name": "僅新增等級 >= X 的角色",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Research": {
|
||||
|
||||
@@ -643,27 +643,34 @@ class RewardTacticalClass(Dock):
|
||||
# Wait until they turn into
|
||||
# [120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120]
|
||||
level_ocr = LevelOcr(CARD_LEVEL_GRIDS.buttons, name='DOCK_LEVEL_OCR', threshold=64)
|
||||
timeout = Timer(1, count=1).start()
|
||||
while 1:
|
||||
list_level = []
|
||||
for _ in self.loop(timeout=1):
|
||||
list_level = level_ocr.ocr(self.device.image)
|
||||
first_ship = next((i for i, x in enumerate(list_level) if x > 0), len(list_level))
|
||||
first_empty = next((i for i, x in enumerate(list_level) if x == 0), len(list_level))
|
||||
if timeout.reached():
|
||||
logger.warning('Wait ship cards timeout')
|
||||
break
|
||||
if first_empty >= first_ship:
|
||||
break
|
||||
self.device.screenshot()
|
||||
else:
|
||||
logger.warning('Wait ship cards timeout')
|
||||
|
||||
try:
|
||||
min_level = int(self.config.AddNewStudent_MinLevel)
|
||||
if min_level < 1:
|
||||
min_level = 1
|
||||
except (ValueError, TypeError) as e:
|
||||
logger.warning(f'Invalid AddNewStudent_MinLevel: {self.config.AddNewStudent_MinLevel}, {e}')
|
||||
min_level = 1
|
||||
logger.attr('AddNewStudent_MinLevel', min_level)
|
||||
|
||||
should_select_button = None
|
||||
for button, level in list(zip(CARD_GRIDS.buttons, list_level))[self.dock_select_index:]:
|
||||
# Select ship LV > 1 only
|
||||
if level > 1:
|
||||
if level >= min_level:
|
||||
should_select_button = button
|
||||
break
|
||||
|
||||
if should_select_button is None:
|
||||
logger.info('No ships with level > 1 in dock')
|
||||
logger.info(f'No ships with level >= {min_level} in dock')
|
||||
return False
|
||||
|
||||
# select a ship
|
||||
|
||||
Reference in New Issue
Block a user