mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-23 00:52:22 +00:00
Fix: [EN] Fix Miss detect lines as characters in Commission module
This commit is contained in:
parent
7c15659f7f
commit
ae88a57eba
@ -124,7 +124,7 @@ command = daily
|
|||||||
[Main]
|
[Main]
|
||||||
command = main
|
command = main
|
||||||
main_stage = 7-2
|
main_stage = 7-2
|
||||||
enable_hard_main_campaign = normal
|
campaign_mode = normal
|
||||||
|
|
||||||
[Event]
|
[Event]
|
||||||
command = event
|
command = event
|
||||||
|
@ -71,10 +71,11 @@ class CampaignUI(UI, CampaignOcr):
|
|||||||
entrance.name = name
|
entrance.name = name
|
||||||
return entrance
|
return entrance
|
||||||
|
|
||||||
def ensure_campaign_ui(self, name):
|
def ensure_campaign_ui(self, name, mode='normal'):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
name (str): Campaign name, such as '7-2', 'd3', 'sp3'.
|
name (str): Campaign name, such as '7-2', 'd3', 'sp3'.
|
||||||
|
mode (str): 'normal' or 'hard'.
|
||||||
"""
|
"""
|
||||||
chapter, _ = separate_name(name)
|
chapter, _ = separate_name(name)
|
||||||
|
|
||||||
@ -82,7 +83,7 @@ class CampaignUI(UI, CampaignOcr):
|
|||||||
self.ui_weigh_anchor()
|
self.ui_weigh_anchor()
|
||||||
self.campaign_ensure_mode('normal')
|
self.campaign_ensure_mode('normal')
|
||||||
self.campaign_ensure_chapter(index=chapter)
|
self.campaign_ensure_chapter(index=chapter)
|
||||||
if self.config.ENABLE_HARD_MAIN_CAMPAIGN == 'hard':
|
if mode == 'hard':
|
||||||
self.campaign_ensure_mode('hard')
|
self.campaign_ensure_mode('hard')
|
||||||
|
|
||||||
elif chapter in 'abcd':
|
elif chapter in 'abcd':
|
||||||
|
@ -182,7 +182,7 @@ class CampaignRun(CampaignUI, Reward):
|
|||||||
def handle_campaign_ui(self):
|
def handle_campaign_ui(self):
|
||||||
for n in range(20):
|
for n in range(20):
|
||||||
try:
|
try:
|
||||||
self.ensure_campaign_ui(name=self.stage)
|
self.ensure_campaign_ui(name=self.stage, mode=self.config.CAMPAIGN_MODE)
|
||||||
self.campaign.ENTRANCE = self.campaign_get_entrance(name=self.stage)
|
self.campaign.ENTRANCE = self.campaign_get_entrance(name=self.stage)
|
||||||
return True
|
return True
|
||||||
except CampaignNameError:
|
except CampaignNameError:
|
||||||
|
@ -326,7 +326,7 @@ def main(ini_name=''):
|
|||||||
# 选择关卡
|
# 选择关卡
|
||||||
stage = main_parser.add_argument_group('Choose a level', 'Main campaign, Currently, not all maps are being supported, check the folder /doc/development_en.md to know how add new maps')
|
stage = main_parser.add_argument_group('Choose a level', 'Main campaign, Currently, not all maps are being supported, check the folder /doc/development_en.md to know how add new maps')
|
||||||
stage.add_argument('--main_stage', default=default('--main_stage'), help='E.g 7-2')
|
stage.add_argument('--main_stage', default=default('--main_stage'), help='E.g 7-2')
|
||||||
stage.add_argument('--enable_hard_main_campaign', default=default('--enable_hard_main_campaign'), help='Useful if you want to clear a hard mode map', choices=['normal', 'hard'])
|
stage.add_argument('--campaign_mode', default=default('--campaign_mode'), help='Useful if you want to clear a hard mode map', choices=['normal', 'hard'])
|
||||||
|
|
||||||
# ==========event==========
|
# ==========event==========
|
||||||
event_parser = subs.add_parser('event')
|
event_parser = subs.add_parser('event')
|
||||||
|
@ -110,7 +110,6 @@ class AzurLaneConfig:
|
|||||||
"""
|
"""
|
||||||
CAMPAIGN_NAME = 'default'
|
CAMPAIGN_NAME = 'default'
|
||||||
CAMPAIGN_MODE = 'normal'
|
CAMPAIGN_MODE = 'normal'
|
||||||
ENABLE_HARD_MAIN_CAMPAIGN = ''
|
|
||||||
|
|
||||||
ENABLE_STOP_CONDITION = True
|
ENABLE_STOP_CONDITION = True
|
||||||
ENABLE_FAST_FORWARD = True
|
ENABLE_FAST_FORWARD = True
|
||||||
@ -482,7 +481,7 @@ class AzurLaneConfig:
|
|||||||
self.TACTICAL_EXP_FIRST_NIGHT = to_bool(option['tactical_exp_first_night'])
|
self.TACTICAL_EXP_FIRST_NIGHT = to_bool(option['tactical_exp_first_night'])
|
||||||
|
|
||||||
option = config['Main']
|
option = config['Main']
|
||||||
self.ENABLE_HARD_MAIN_CAMPAIGN = option['enable_hard_main_campaign']
|
self.CAMPAIGN_MODE = option['campaign_mode']
|
||||||
self.CAMPAIGN_NAME = option['main_stage']
|
self.CAMPAIGN_NAME = option['main_stage']
|
||||||
self.CAMPAIGN_NAME = 'campaign_' + self.CAMPAIGN_NAME.replace('-', '_')
|
self.CAMPAIGN_NAME = 'campaign_' + self.CAMPAIGN_NAME.replace('-', '_')
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ dic_true_eng_to_eng = {
|
|||||||
'exercise_equipment': 'exercise_equipment',
|
'exercise_equipment': 'exercise_equipment',
|
||||||
'main_stage': 'main_stage',
|
'main_stage': 'main_stage',
|
||||||
'event_stage': 'event_stage',
|
'event_stage': 'event_stage',
|
||||||
'enable_hard_main_campaign': 'enable_hard_main_campaign',
|
'campaign_mode': 'campaign_mode',
|
||||||
'sp_stage': 'sp_stage',
|
'sp_stage': 'sp_stage',
|
||||||
'event_name': 'event_name',
|
'event_name': 'event_name',
|
||||||
'event_name_ab': 'event_name_ab',
|
'event_name_ab': 'event_name_ab',
|
||||||
|
@ -36,16 +36,16 @@ dictionary_en = {
|
|||||||
'major_comm': ['SelfTraining', 'DefenseExercise', 'ResearchMission', 'Prep', 'Class', 'CargoTransport'],
|
'major_comm': ['SelfTraining', 'DefenseExercise', 'ResearchMission', 'Prep', 'Class', 'CargoTransport'],
|
||||||
'daily_comm': ['Daily', 'Awakening'],
|
'daily_comm': ['Daily', 'Awakening'],
|
||||||
'extra_drill': ['Sailing', 'DefensePatrol', 'Buoy', 'saingTraining'],
|
'extra_drill': ['Sailing', 'DefensePatrol', 'Buoy', 'saingTraining'],
|
||||||
'extra_part': ['Protection'],
|
'extra_part': ['Protection', 'Forestprtectioncommisionl', 'veinprotectoncommisionl', 'veinprtectioncommision', 'Forestprotectncommisionll', 'veinprotectncommision'],
|
||||||
'extra_cube': ['FleetExercise', 'EscortExercise', 'FleetCargo', 'CombatExercise'],
|
'extra_cube': ['FleetExercise', 'EscortExercise', 'FleetCargo', 'CombatExercise'],
|
||||||
'extra_oil': ['oil'],
|
'extra_oil': ['oil', 'smallscaleoiExtractionll', 'smal.scaleoiExtractionll'],
|
||||||
'extra_book': ['MerchantEscort'],
|
'extra_book': ['MerchantEscort'],
|
||||||
'urgent_drill': ['CargoDefense', 'Destroy'],
|
'urgent_drill': ['CargoDefense', 'Destroy'],
|
||||||
'urgent_part': ['Lavella', 'Maui', 'Rendova', 'banna', 'Mannelsland'],
|
'urgent_part': ['Lavella', 'Maui', 'Rendova', 'banna', 'Mannelsland'],
|
||||||
'urgent_book': ['Tyrant', 'Poro', 'Makira', 'Kapolo', 'Mary', 'Isle', 'Kotlin'],
|
'urgent_book': ['Tyrant', 'Poro', 'Makira', 'Kapolo', 'Mary', 'Isle', 'Kotlin', 'AidingWapolo'],
|
||||||
'urgent_box': ['Gear', 'Handover'],
|
'urgent_box': ['Gear', 'Handover'],
|
||||||
'urgent_cube': ['MerchantRescue', 'Attack'],
|
'urgent_cube': ['MerchantRescue', 'Attack'],
|
||||||
'urgent_gem': ['VIP ', 'Holiday', 'PatrolEscort'],
|
'urgent_gem': ['VIP ', 'Holiday', 'PatrolEscort', 'BIWWIPEscort', 'BIWVIPEscort'],
|
||||||
'urgent_ship': ['Launch']
|
'urgent_ship': ['Launch']
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ class CommissionGroup:
|
|||||||
# Find commission position
|
# Find commission position
|
||||||
color_height = np.mean(image.crop(
|
color_height = np.mean(image.crop(
|
||||||
(597, 0, 619, 720)).convert('L'), axis=1)
|
(597, 0, 619, 720)).convert('L'), axis=1)
|
||||||
parameters = {'height': 200}
|
parameters = {'height': 200, 'distance': 100}
|
||||||
peaks, _ = signal.find_peaks(color_height, **parameters)
|
peaks, _ = signal.find_peaks(color_height, **parameters)
|
||||||
peaks = [y for y in peaks if y > 67 + 117]
|
peaks = [y for y in peaks if y > 67 + 117]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user