1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-27 02:38:22 +08:00

Merge branch 'dev' into fpy

This commit is contained in:
hgjazhgj
2023-06-03 22:22:42 +08:00
30 changed files with 304 additions and 70 deletions

View File

@@ -168,7 +168,8 @@ Alas 仍在活跃开发中,我们会不定期发布未来的工作在 [Issues]
## 联系我们 Contact Us ## 联系我们 Contact Us
- Discord: [https://discord.gg/AQN6GeJ](https://discord.gg/AQN6GeJ) - Discord: [https://discord.gg/AQN6GeJ](https://discord.gg/AQN6GeJ)
- QQ 群:[576458886](https://jq.qq.com/?_wv=1027&k=FUIOAAOm) - QQ 群:[576458886](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Q611gtXy-y0ttnfHOQNegXjerUI2tWIy&authKey=VjW7e8fxtXTN0twcU6%2FZabZ03gKy%2FuhZETQlFDaswupHRDzVO33lsqZloKG8IfR6&noverify=0&group_code=834210833)
- QQ 二群(已满):[576458886](https://jq.qq.com/?_wv=1027&k=FUIOAAOm)
- QQ 一群(已满):[1087735381](https://jq.qq.com/?_wv=1027&k=I4NSqX7g) - QQ 一群(已满):[1087735381](https://jq.qq.com/?_wv=1027&k=I4NSqX7g)
- Bilibili 直播间https://live.bilibili.com/22216705 偶尔直播写Alas~~为了拯救AlasLme决定出道成为偶像~~ - Bilibili 直播间https://live.bilibili.com/22216705 偶尔直播写Alas~~为了拯救AlasLme决定出道成为偶像~~

View File

@@ -143,4 +143,5 @@ To add a new event, add a new row in here, and run `python -m module.config.conf
| 20230413 | event 20211111 cn | The Flame-Touched Dagger | 复刻杰诺瓦的焰火 | The Flame-Touched Dagger Rerun | 復刻-燈火のシニエ | - | | 20230413 | event 20211111 cn | The Flame-Touched Dagger | 复刻杰诺瓦的焰火 | The Flame-Touched Dagger Rerun | 復刻-燈火のシニエ | - |
| 20230413 | event 20210819 cn | Microlayer Medley | - | - | - | 復刻-微層混合 | | 20230413 | event 20210819 cn | Microlayer Medley | - | - | - | 復刻-微層混合 |
| 20230427 | event 20201126 cn | Vacation Lane | 假日航线 | Vacation Lane | バケーションレーン | 假日航線 | | 20230427 | event 20201126 cn | Vacation Lane | 假日航线 | Vacation Lane | バケーションレーン | 假日航線 |
| 20230525 | event 20220526 cn | Pledge of the Radiant Court | - | - | - | 泠誓光庭 |
| 20230525 | event 20230525 cn | Confluence of Nothingness | 空相交汇点 | Confluence of Nothingness | 覆天せし万象の塵 | - | | 20230525 | event 20230525 cn | Confluence of Nothingness | 空相交汇点 | Confluence of Nothingness | 覆天せし万象の塵 | - |

View File

@@ -8,6 +8,7 @@ from module.logger import logger
# Here manually type coordinates, because the ball appears in this event only. # Here manually type coordinates, because the ball appears in this event only.
BALL = Button(area=(589, 279, 685, 374), color=(), button=(589, 279, 685, 374)) BALL = Button(area=(589, 279, 685, 374), color=(), button=(589, 279, 685, 374))
class CampaignBase(CampaignBase_): class CampaignBase(CampaignBase_):
STAGE_INCREASE = [ STAGE_INCREASE = [
'T1 > T2 > TS1 > T3', 'T1 > T2 > TS1 > T3',

View File

@@ -0,0 +1,164 @@
from module.base.utils import location2node
from module.exception import RequestHumanTakeover, ScriptError
from .campaign_base import CampaignBase
from .config_base import ConfigBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
MAP = CampaignMap('SP')
MAP.shape = 'J8'
MAP.camera_data_spawn_point = ['E6']
MAP.map_data = """
++ ++ ++ ME ME ME ME ++ ++ ++
++ ME ME ME ME ME ME ME ME ++
ME ME ME ME ++ ++ ME ME ME ME
ME ME ME ME ++ ++ ME ME ME ME
ME ME ME ME MB MB ME ME ME ME
ME ++ ME ME __ __ ME ME ++ ME
ME ++ ME ME ME ME ME ME ++ ME
ME ME ME ME SP SP ME ME ME ME
"""
MAP.weight_data = """
50 50 50 50 50 50 50 50 50 50
50 50 50 50 50 50 50 50 50 50
50 50 50 50 50 50 50 50 50 50
50 50 50 50 50 50 50 50 50 50
50 50 50 50 50 50 50 50 50 50
50 50 50 50 50 50 50 50 50 50
50 50 50 50 50 50 50 50 50 50
50 50 50 50 50 50 50 50 50 50
"""
MAP.spawn_data = [
{'battle': 0, 'siren': 4},
{'battle': 1},
{'battle': 2},
{'battle': 3},
{'battle': 4, 'enemy': 14},
{'battle': 5},
{'battle': 6},
{'battle': 7, 'boss': 1},
]
A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, \
A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, \
A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, \
A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, \
A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, \
A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, \
A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, \
A8, B8, C8, D8, E8, F8, G8, H8, I8, J8, \
= MAP.flatten()
class Config(ConfigBase):
# ===== Start of generated config =====
MAP_HAS_SIREN = False
MAP_HAS_MOVABLE_ENEMY = False
MAP_HAS_MOVABLE_NORMAL_ENEMY = False
MAP_HAS_MAP_STORY = True
MAP_HAS_FLEET_STEP = True
MAP_HAS_AMBUSH = False
MAP_HAS_MYSTERY = False
STAR_REQUIRE_1 = 0
STAR_REQUIRE_2 = 0
STAR_REQUIRE_3 = 0
# ===== End of generated config =====
MAP_IS_ONE_TIME_STAGE = True
# hard to find a dynamic solution
# therefore overwrite all MAP girds with ME
# and use a serial of static actions
actions = {
4: [
['1_R_2_', '1_L_2_', '1_R_2_B'],
['2_U_2_', '1_S_0_B'],
['1_L_1_B'],
['1_U_1_B'],
['1_U_2_', '1_R_1_B'],
['1_L_2_', '1_L_1_B'],
['1_R_2_', '1_R_1_B']
],
5: [
['1_L_2_', '1_R_2_', '1_L_2_B'],
['2_U_2_', '1_S_0_B'],
['1_RU_2_', '1_RU_2_B'],
['1_RD_2_B'],
['1_U_2_B'],
['1_L_2_', '1_L_1_B'],
['1_R_2_', '1_L_2_B']
]
}
def parse_move(movement: str, step: int):
if step % len(movement) != 0:
raise ScriptError('Invalid movement')
movement = movement * int(step / len(movement))
dx, dy = 0, 0
for direction in movement:
dx += 1 if direction == 'R' else 0
dx -= 1 if direction == 'L' else 0
dy += 1 if direction == 'D' else 0
dy -= 1 if direction == 'U' else 0
return dx, dy
class Campaign(CampaignBase):
MAP = MAP
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
siren_list = [C7, D6, G6, H7]
patched = False
action = []
def execute_actions(self, step):
for action in self.action[step]:
fleet_index, movement, step, battle = action.split('_')
src = self.__getattribute__(f'fleet_{fleet_index}_location')
fleet = self.__getattribute__(f'fleet_{fleet_index}')
step = int(step)
dx, dy = parse_move(movement, step)
dst = (src[0] + dx, src[1] + dy)
logger.info(f'{fleet_index}{movement}({step}): {src} -> {dst}')
for _ in range(3):
if battle:
fleet.clear_chosen_enemy(location2node(dst))
else:
fleet.goto(location2node(dst))
fleet_location = self.__getattribute__(f'fleet_{fleet_index}_location')
if fleet_location not in [src, dst]:
raise RequestHumanTakeover(
f'Fleet{fleet_index} fail to move {src} -> {dst}, now on {fleet_location}')
elif fleet_location == dst:
break
else:
logger.warning(f'Fleet{fleet_index} did not move, retry')
return True
def battle_0(self):
if not self.patched:
for battle_count in range(1, 7):
setattr(self, f'battle_{battle_count}', self.battle_0)
self.patched = True
if self.map_is_clear_mode:
if self.siren_list:
self.fleet_1.clear_chosen_enemy(self.siren_list.pop())
return True
else:
if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0):
return True
else:
if not self.action:
self.action = actions[self.fleet_1_location[0]]
return self.execute_actions(self.battle_count)
def battle_7(self):
return self.fleet_boss.clear_boss()

View File

@@ -769,7 +769,7 @@ class ResearchPool:
Returns: Returns:
np.ndarray: Shape (188,), lower index means to be selected first. 1000 for not selected projects. np.ndarray: Shape (188,), lower index means to be selected first. 1000 for not selected projects.
""" """
out = np.ones((PROJECTS.count,), dtype=np.int64) * 1000 out = np.ones((PROJECTS.count,), dtype=int) * 1000
for index, project in enumerate(self.filter): for index, project in enumerate(self.filter):
if index != self.reset_index: if index != self.reset_index:
out[project.index] = index out[project.index] = index

View File

@@ -54,8 +54,8 @@ def random_rectangle_vector(vector, box, random_range=(0, 0, 0, 0), padding=15):
tuple(int), tuple(int): start_point, end_point. tuple(int), tuple(int): start_point, end_point.
""" """
vector = np.array(vector) + random_rectangle_point(random_range) vector = np.array(vector) + random_rectangle_point(random_range)
vector = np.round(vector).astype(np.int) vector = np.round(vector).astype(int)
half_vector = np.round(vector / 2).astype(np.int) half_vector = np.round(vector / 2).astype(int)
box = np.array(box) + np.append(np.abs(half_vector) + padding, -np.abs(half_vector) - padding) box = np.array(box) + np.append(np.abs(half_vector) + padding, -np.abs(half_vector) - padding)
center = random_rectangle_point(box) center = random_rectangle_point(box)
start_point = center - half_vector start_point = center - half_vector
@@ -86,8 +86,8 @@ def random_rectangle_vector_opted(
tuple(int), tuple(int): start_point, end_point. tuple(int), tuple(int): start_point, end_point.
""" """
vector = np.array(vector) + random_rectangle_point(random_range) vector = np.array(vector) + random_rectangle_point(random_range)
vector = np.round(vector).astype(np.int) vector = np.round(vector).astype(int)
half_vector = np.round(vector / 2).astype(np.int) half_vector = np.round(vector / 2).astype(int)
box_pad = np.array(box) + np.append(np.abs(half_vector) + padding, -np.abs(half_vector) - padding) box_pad = np.array(box) + np.append(np.abs(half_vector) + padding, -np.abs(half_vector) - padding)
box_pad = area_offset(box_pad, half_vector) box_pad = area_offset(box_pad, half_vector)
segment = int(np.linalg.norm(vector) // 70) + 1 segment = int(np.linalg.norm(vector) // 70) + 1

View File

@@ -153,6 +153,18 @@ class CampaignOcr(ModuleBase):
image, extract_letters(self._stage_image, letter=(99, 223, 239), threshold=153), image, extract_letters(self._stage_image, letter=(99, 223, 239), threshold=153),
name_offset=(60, 12), name_size=(60, 16) name_offset=(60, 12), name_size=(60, 16)
) )
if 'green' in self.config.STAGE_ENTRANCE:
digits += self.campaign_match_multi(
TEMPLATE_STAGE_GREEN_CLEAR,
image, self._stage_image_gray,
name_offset=(60, 0), name_size=(60, 22)
)
digits += self.campaign_match_multi(
TEMPLATE_STAGE_PERCENT,
image, self._stage_image_gray,
similarity=0.6,
name_offset=(52, 0), name_size=(60, 22)
)
return digits return digits

View File

@@ -43,6 +43,11 @@ class GemsCampaignOverride(CampaignBase):
if self.appear(BATTLE_PREPARATION, offset=(20, 20), interval=2): if self.appear(BATTLE_PREPARATION, offset=(20, 20), interval=2):
self.device.click(BACK_ARROW) self.device.click(BACK_ARROW)
continue
if self.handle_auto_search_exit():
continue
if self.is_in_stage():
break
if self.is_in_map(): if self.is_in_map():
self.withdraw() self.withdraw()

View File

@@ -166,6 +166,18 @@ class CampaignRun(CampaignEvent):
""" """
name = re.sub('[ \t\n]', '', str(name)).lower() name = re.sub('[ \t\n]', '', str(name)).lower()
name = to_map_file_name(name) name = to_map_file_name(name)
# For GemsFarming, auto choose events or main chapters
if self.config.task.command == 'GemsFarming':
if self.stage_is_main(name):
logger.info(f'Stage name {name} is from campaign_main')
folder = 'campaign_main'
else:
folder = self.config.cross_get('Event.Campaign.Event')
if folder is not None:
logger.info(f'Stage name {name} is from event {folder}')
else:
logger.warning(f'Cannot get the latest event, fallback to campaign_main')
folder = 'campaign_main'
# Handle special names SP maps # Handle special names SP maps
if folder == 'event_20201126_cn' and name == 'vsp': if folder == 'event_20201126_cn' and name == 'vsp':
name = 'sp' name = 'sp'
@@ -229,18 +241,6 @@ class CampaignRun(CampaignEvent):
f'run ordered stage: {stage}') f'run ordered stage: {stage}')
name = stage.lower() name = stage.lower()
self.is_stage_loop = True self.is_stage_loop = True
# For GemsFarming, auto choose events or main chapters
if self.config.task.command == 'GemsFarming':
if self.stage_is_main(name):
logger.info(f'Stage name {name} is from campaign_main')
folder = 'campaign_main'
else:
folder = self.config.cross_get('Event.Campaign.Event')
if folder is not None:
logger.info(f'Stage name {name} is from event {folder}')
else:
logger.warning(f'Cannot get the latest event, fallback to campaign_main')
folder = 'campaign_main'
return name, folder return name, folder

View File

@@ -23,10 +23,13 @@
"com.bilibili.blhx.nearme.gamecenter", "com.bilibili.blhx.nearme.gamecenter",
"com.bilibili.blhx.vivo", "com.bilibili.blhx.vivo",
"com.bilibili.blhx.mz", "com.bilibili.blhx.mz",
"com.bilibili.blhx.dl",
"com.bilibili.blhx.lenovo",
"com.bilibili.blhx.uc", "com.bilibili.blhx.uc",
"com.bilibili.blhx.mzw", "com.bilibili.blhx.mzw",
"com.yiwu.blhx.yx15", "com.yiwu.blhx.yx15",
"com.bilibili.blhx.m4399", "com.bilibili.blhx.m4399",
"com.bilibili.blhx.bilibiliMove",
"com.hkmanjuu.azurlane.gp.mc" "com.hkmanjuu.azurlane.gp.mc"
] ]
}, },
@@ -1600,6 +1603,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -1628,7 +1632,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -1660,7 +1663,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",
@@ -2321,6 +2324,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -2349,7 +2353,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -2381,7 +2384,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",
@@ -2755,6 +2758,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -2783,7 +2787,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -2815,7 +2818,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",
@@ -4099,6 +4102,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -4127,7 +4131,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -4159,7 +4162,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",
@@ -4550,6 +4553,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -4578,7 +4582,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -4610,7 +4613,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",
@@ -5001,6 +5004,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -5029,7 +5033,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -5061,7 +5064,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",
@@ -5452,6 +5455,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -5480,7 +5484,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -5512,7 +5515,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",
@@ -5893,6 +5896,7 @@
"value": "campaign_main", "value": "campaign_main",
"option": [ "option": [
"event_20230525_cn", "event_20230525_cn",
"event_20220526_cn",
"event_20201126_cn", "event_20201126_cn",
"event_20210819_cn", "event_20210819_cn",
"event_20211111_cn", "event_20211111_cn",
@@ -5921,7 +5925,6 @@
"event_20200820_cn", "event_20200820_cn",
"event_20201012_cn", "event_20201012_cn",
"event_20210527_cn", "event_20210527_cn",
"event_20220526_cn",
"event_20220428_cn", "event_20220428_cn",
"event_20220414_cn", "event_20220414_cn",
"event_20220407_tw", "event_20220407_tw",
@@ -5953,7 +5956,7 @@
"cn": "event_20230525_cn", "cn": "event_20230525_cn",
"en": "event_20230525_cn", "en": "event_20230525_cn",
"jp": "event_20230525_cn", "jp": "event_20230525_cn",
"tw": "event_20201126_cn" "tw": "event_20220526_cn"
}, },
"Mode": { "Mode": {
"type": "select", "type": "select",

View File

@@ -19,7 +19,7 @@ class GeneratedConfig:
# Group `Emulator` # Group `Emulator`
Emulator_Serial = 'auto' Emulator_Serial = 'auto'
Emulator_PackageName = 'auto' # auto, com.bilibili.azurlane, com.YoStarEN.AzurLane, com.YoStarJP.AzurLane, com.hkmanjuu.azurlane.gp, com.bilibili.blhx.huawei, com.bilibili.blhx.mi, com.tencent.tmgp.bilibili.blhx, com.bilibili.blhx.baidu, com.bilibili.blhx.qihoo, com.bilibili.blhx.nearme.gamecenter, com.bilibili.blhx.vivo, com.bilibili.blhx.mz, com.bilibili.blhx.uc, com.bilibili.blhx.mzw, com.yiwu.blhx.yx15, com.bilibili.blhx.m4399, com.hkmanjuu.azurlane.gp.mc Emulator_PackageName = 'auto' # auto, com.bilibili.azurlane, com.YoStarEN.AzurLane, com.YoStarJP.AzurLane, com.hkmanjuu.azurlane.gp, com.bilibili.blhx.huawei, com.bilibili.blhx.mi, com.tencent.tmgp.bilibili.blhx, com.bilibili.blhx.baidu, com.bilibili.blhx.qihoo, com.bilibili.blhx.nearme.gamecenter, com.bilibili.blhx.vivo, com.bilibili.blhx.mz, com.bilibili.blhx.dl, com.bilibili.blhx.lenovo, com.bilibili.blhx.uc, com.bilibili.blhx.mzw, com.yiwu.blhx.yx15, com.bilibili.blhx.m4399, com.bilibili.blhx.bilibiliMove, com.hkmanjuu.azurlane.gp.mc
Emulator_ServerName = 'disabled' # disabled, cn_android-0, cn_android-1, cn_android-2, cn_android-3, cn_android-4, cn_android-5, cn_android-6, cn_android-7, cn_android-8, cn_android-9, cn_android-10, cn_android-11, cn_android-12, cn_android-13, cn_android-14, cn_android-15, cn_android-16, cn_android-17, cn_android-18, cn_android-19, cn_android-20, cn_android-21, cn_android-22, cn_android-23, cn_ios-0, cn_ios-1, cn_ios-2, cn_ios-3, cn_ios-4, cn_ios-5, cn_ios-6, cn_ios-7, cn_ios-8, cn_ios-9, cn_ios-10, cn_channel-0, cn_channel-1, cn_channel-2, cn_channel-3, cn_channel-4, en-0, en-1, en-2, en-3, en-4, en-5, jp-0, jp-1, jp-2, jp-3, jp-4, jp-5, jp-6, jp-7, jp-8, jp-9, jp-10, jp-11, jp-12, jp-13, jp-14, jp-15, jp-16, jp-17 Emulator_ServerName = 'disabled' # disabled, cn_android-0, cn_android-1, cn_android-2, cn_android-3, cn_android-4, cn_android-5, cn_android-6, cn_android-7, cn_android-8, cn_android-9, cn_android-10, cn_android-11, cn_android-12, cn_android-13, cn_android-14, cn_android-15, cn_android-16, cn_android-17, cn_android-18, cn_android-19, cn_android-20, cn_android-21, cn_android-22, cn_android-23, cn_ios-0, cn_ios-1, cn_ios-2, cn_ios-3, cn_ios-4, cn_ios-5, cn_ios-6, cn_ios-7, cn_ios-8, cn_ios-9, cn_ios-10, cn_channel-0, cn_channel-1, cn_channel-2, cn_channel-3, cn_channel-4, en-0, en-1, en-2, en-3, en-4, en-5, jp-0, jp-1, jp-2, jp-3, jp-4, jp-5, jp-6, jp-7, jp-8, jp-9, jp-10, jp-11, jp-12, jp-13, jp-14, jp-15, jp-16, jp-17
Emulator_ScreenshotMethod = 'auto' # auto, ADB, ADB_nc, uiautomator2, aScreenCap, aScreenCap_nc, DroidCast, DroidCast_raw, scrcpy Emulator_ScreenshotMethod = 'auto' # auto, ADB, ADB_nc, uiautomator2, aScreenCap, aScreenCap_nc, DroidCast, DroidCast_raw, scrcpy
Emulator_ControlMethod = 'minitouch' # ADB, uiautomator2, minitouch, Hermit, MaaTouch Emulator_ControlMethod = 'minitouch' # ADB, uiautomator2, minitouch, Hermit, MaaTouch

View File

@@ -322,10 +322,13 @@
"com.bilibili.blhx.nearme.gamecenter": "CN com.bilibili.blhx.nearme.gamecenter", "com.bilibili.blhx.nearme.gamecenter": "CN com.bilibili.blhx.nearme.gamecenter",
"com.bilibili.blhx.vivo": "CN com.bilibili.blhx.vivo", "com.bilibili.blhx.vivo": "CN com.bilibili.blhx.vivo",
"com.bilibili.blhx.mz": "CN com.bilibili.blhx.mz", "com.bilibili.blhx.mz": "CN com.bilibili.blhx.mz",
"com.bilibili.blhx.dl": "CN com.bilibili.blhx.dl",
"com.bilibili.blhx.lenovo": "CN com.bilibili.blhx.lenovo",
"com.bilibili.blhx.uc": "CN com.bilibili.blhx.uc", "com.bilibili.blhx.uc": "CN com.bilibili.blhx.uc",
"com.bilibili.blhx.mzw": "CN com.bilibili.blhx.mzw", "com.bilibili.blhx.mzw": "CN com.bilibili.blhx.mzw",
"com.yiwu.blhx.yx15": "CN com.yiwu.blhx.yx15", "com.yiwu.blhx.yx15": "CN com.yiwu.blhx.yx15",
"com.bilibili.blhx.m4399": "CN com.bilibili.blhx.m4399", "com.bilibili.blhx.m4399": "CN com.bilibili.blhx.m4399",
"com.bilibili.blhx.bilibiliMove": "CN com.bilibili.blhx.bilibiliMove",
"com.hkmanjuu.azurlane.gp.mc": "TW com.hkmanjuu.azurlane.gp.mc" "com.hkmanjuu.azurlane.gp.mc": "TW com.hkmanjuu.azurlane.gp.mc"
}, },
"ServerName": { "ServerName": {
@@ -654,6 +657,7 @@
"help": "Automatically selects to the latest event", "help": "Automatically selects to the latest event",
"campaign_main": "campaign_main", "campaign_main": "campaign_main",
"event_20230525_cn": "Confluence of Nothingness", "event_20230525_cn": "Confluence of Nothingness",
"event_20220526_cn": "Pledge of the Radiant Court",
"event_20201126_cn": "Vacation Lane", "event_20201126_cn": "Vacation Lane",
"event_20210819_cn": "Microlayer Medley Rerun", "event_20210819_cn": "Microlayer Medley Rerun",
"event_20211111_cn": "The Flame-Touched Dagger Rerun", "event_20211111_cn": "The Flame-Touched Dagger Rerun",
@@ -688,7 +692,6 @@
"event_20200820_cn": "Scherzo of Iron and Blood Rerun", "event_20200820_cn": "Scherzo of Iron and Blood Rerun",
"event_20201012_cn": "Sundered Blue Rerun", "event_20201012_cn": "Sundered Blue Rerun",
"event_20210527_cn": "Mirror Involution", "event_20210527_cn": "Mirror Involution",
"event_20220526_cn": "Pledge of the Radiant Court",
"raid_20200624": "Air Raid Drills with Essex Rerun", "raid_20200624": "Air Raid Drills with Essex Rerun",
"event_20220428_cn": "Rondo at Rainbows End", "event_20220428_cn": "Rondo at Rainbows End",
"event_20220414_cn": "Aurora Noctis Rerun", "event_20220414_cn": "Aurora Noctis Rerun",

View File

@@ -322,10 +322,13 @@
"com.bilibili.blhx.nearme.gamecenter": "CN com.bilibili.blhx.nearme.gamecenter", "com.bilibili.blhx.nearme.gamecenter": "CN com.bilibili.blhx.nearme.gamecenter",
"com.bilibili.blhx.vivo": "CN com.bilibili.blhx.vivo", "com.bilibili.blhx.vivo": "CN com.bilibili.blhx.vivo",
"com.bilibili.blhx.mz": "CN com.bilibili.blhx.mz", "com.bilibili.blhx.mz": "CN com.bilibili.blhx.mz",
"com.bilibili.blhx.dl": "CN com.bilibili.blhx.dl",
"com.bilibili.blhx.lenovo": "CN com.bilibili.blhx.lenovo",
"com.bilibili.blhx.uc": "CN com.bilibili.blhx.uc", "com.bilibili.blhx.uc": "CN com.bilibili.blhx.uc",
"com.bilibili.blhx.mzw": "CN com.bilibili.blhx.mzw", "com.bilibili.blhx.mzw": "CN com.bilibili.blhx.mzw",
"com.yiwu.blhx.yx15": "CN com.yiwu.blhx.yx15", "com.yiwu.blhx.yx15": "CN com.yiwu.blhx.yx15",
"com.bilibili.blhx.m4399": "CN com.bilibili.blhx.m4399", "com.bilibili.blhx.m4399": "CN com.bilibili.blhx.m4399",
"com.bilibili.blhx.bilibiliMove": "CN com.bilibili.blhx.bilibiliMove",
"com.hkmanjuu.azurlane.gp.mc": "TW com.hkmanjuu.azurlane.gp.mc" "com.hkmanjuu.azurlane.gp.mc": "TW com.hkmanjuu.azurlane.gp.mc"
}, },
"ServerName": { "ServerName": {
@@ -654,6 +657,7 @@
"help": "Campaign.Event.help", "help": "Campaign.Event.help",
"campaign_main": "campaign_main", "campaign_main": "campaign_main",
"event_20230525_cn": "覆天せし万象の塵", "event_20230525_cn": "覆天せし万象の塵",
"event_20220526_cn": "诚閃の剣 搖光の城",
"event_20201126_cn": "バケーションレーン", "event_20201126_cn": "バケーションレーン",
"event_20210819_cn": "闇靄払う銀翼(復刻)", "event_20210819_cn": "闇靄払う銀翼(復刻)",
"event_20211111_cn": "復刻-燈火のシニエ", "event_20211111_cn": "復刻-燈火のシニエ",
@@ -688,7 +692,6 @@
"event_20200820_cn": "黒鉄の楽章 誓いの海(復刻)", "event_20200820_cn": "黒鉄の楽章 誓いの海(復刻)",
"event_20201012_cn": "奔る彩帆の青(復刻)", "event_20201012_cn": "奔る彩帆の青(復刻)",
"event_20210527_cn": "照らす螺旋の鏡海", "event_20210527_cn": "照らす螺旋の鏡海",
"event_20220526_cn": "诚閃の剣 搖光の城",
"raid_20200624": "特別演習超空強襲波(復刻)", "raid_20200624": "特別演習超空強襲波(復刻)",
"event_20220428_cn": "吟ずる瑠璃の楽章", "event_20220428_cn": "吟ずる瑠璃の楽章",
"event_20220414_cn": "極夜照らす幻光(復刻)", "event_20220414_cn": "極夜照らす幻光(復刻)",

View File

@@ -322,10 +322,13 @@
"com.bilibili.blhx.nearme.gamecenter": "国服 oppo渠道服 com.bilibili.blhx.nearme.gamecenter", "com.bilibili.blhx.nearme.gamecenter": "国服 oppo渠道服 com.bilibili.blhx.nearme.gamecenter",
"com.bilibili.blhx.vivo": "国服 vivo渠道服 com.bilibili.blhx.vivo", "com.bilibili.blhx.vivo": "国服 vivo渠道服 com.bilibili.blhx.vivo",
"com.bilibili.blhx.mz": "国服 魅族渠道服 com.bilibili.blhx.mz", "com.bilibili.blhx.mz": "国服 魅族渠道服 com.bilibili.blhx.mz",
"com.bilibili.blhx.dl": "国服 当乐渠道服 com.bilibili.blhx.dl",
"com.bilibili.blhx.lenovo": "国服 联想渠道服 com.bilibili.blhx.lenovo",
"com.bilibili.blhx.uc": "国服 UC九游渠道服 com.bilibili.blhx.uc", "com.bilibili.blhx.uc": "国服 UC九游渠道服 com.bilibili.blhx.uc",
"com.bilibili.blhx.mzw": "国服 拇指玩渠道服 com.bilibili.blhx.mzw", "com.bilibili.blhx.mzw": "国服 拇指玩渠道服 com.bilibili.blhx.mzw",
"com.yiwu.blhx.yx15": "国服 一五游戏渠道服 com.yiwu.blhx.yx15", "com.yiwu.blhx.yx15": "国服 一五游戏渠道服 com.yiwu.blhx.yx15",
"com.bilibili.blhx.m4399": "国服 4399渠道服 com.bilibili.blhx.m4399", "com.bilibili.blhx.m4399": "国服 4399渠道服 com.bilibili.blhx.m4399",
"com.bilibili.blhx.bilibiliMove": "国服 迁移渠道服 com.bilibili.blhx.bilibiliMove",
"com.hkmanjuu.azurlane.gp.mc": "台服 com.hkmanjuu.azurlane.gp.mc" "com.hkmanjuu.azurlane.gp.mc": "台服 com.hkmanjuu.azurlane.gp.mc"
}, },
"ServerName": { "ServerName": {
@@ -654,6 +657,7 @@
"help": "自动选择至最新的活动", "help": "自动选择至最新的活动",
"campaign_main": "主线图", "campaign_main": "主线图",
"event_20230525_cn": "空相交汇点", "event_20230525_cn": "空相交汇点",
"event_20220526_cn": "泠誓光庭",
"event_20201126_cn": "假日航线", "event_20201126_cn": "假日航线",
"event_20210819_cn": "复刻微层混合", "event_20210819_cn": "复刻微层混合",
"event_20211111_cn": "复刻杰诺瓦的焰火", "event_20211111_cn": "复刻杰诺瓦的焰火",
@@ -688,7 +692,6 @@
"event_20200820_cn": "复刻铁血音符誓言", "event_20200820_cn": "复刻铁血音符誓言",
"event_20201012_cn": "复刻划破海空之翼", "event_20201012_cn": "复刻划破海空之翼",
"event_20210527_cn": "镜位螺旋", "event_20210527_cn": "镜位螺旋",
"event_20220526_cn": "泠誓光庭",
"raid_20200624": "复刻特别演习埃塞克斯级", "raid_20200624": "复刻特别演习埃塞克斯级",
"event_20220428_cn": "虹彩的终幕曲", "event_20220428_cn": "虹彩的终幕曲",
"event_20220414_cn": "复刻永夜幻光", "event_20220414_cn": "复刻永夜幻光",

View File

@@ -322,10 +322,13 @@
"com.bilibili.blhx.nearme.gamecenter": "國服 com.bilibili.blhx.nearme.gamecenter", "com.bilibili.blhx.nearme.gamecenter": "國服 com.bilibili.blhx.nearme.gamecenter",
"com.bilibili.blhx.vivo": "國服 com.bilibili.blhx.vivo", "com.bilibili.blhx.vivo": "國服 com.bilibili.blhx.vivo",
"com.bilibili.blhx.mz": "國服 com.bilibili.blhx.mz", "com.bilibili.blhx.mz": "國服 com.bilibili.blhx.mz",
"com.bilibili.blhx.dl": "國服 com.bilibili.blhx.dl",
"com.bilibili.blhx.lenovo": "國服 com.bilibili.blhx.lenovo",
"com.bilibili.blhx.uc": "國服 com.bilibili.blhx.uc", "com.bilibili.blhx.uc": "國服 com.bilibili.blhx.uc",
"com.bilibili.blhx.mzw": "國服 com.bilibili.blhx.mzw", "com.bilibili.blhx.mzw": "國服 com.bilibili.blhx.mzw",
"com.yiwu.blhx.yx15": "國服 com.yiwu.blhx.yx15", "com.yiwu.blhx.yx15": "國服 com.yiwu.blhx.yx15",
"com.bilibili.blhx.m4399": "國服 com.bilibili.blhx.m4399", "com.bilibili.blhx.m4399": "國服 com.bilibili.blhx.m4399",
"com.bilibili.blhx.bilibiliMove": "國服 com.bilibili.blhx.bilibiliMove",
"com.hkmanjuu.azurlane.gp.mc": "台服 MyCard渠道服 com.hkmanjuu.azurlane.gp.mc" "com.hkmanjuu.azurlane.gp.mc": "台服 MyCard渠道服 com.hkmanjuu.azurlane.gp.mc"
}, },
"ServerName": { "ServerName": {
@@ -654,6 +657,7 @@
"help": "自動選擇至最新的活動圖", "help": "自動選擇至最新的活動圖",
"campaign_main": "主線圖", "campaign_main": "主線圖",
"event_20230525_cn": "Confluence of Nothingness", "event_20230525_cn": "Confluence of Nothingness",
"event_20220526_cn": "泠誓光庭",
"event_20201126_cn": "假日航線", "event_20201126_cn": "假日航線",
"event_20210819_cn": "復刻-微層混合", "event_20210819_cn": "復刻-微層混合",
"event_20211111_cn": "杰諾瓦的焰火", "event_20211111_cn": "杰諾瓦的焰火",
@@ -688,7 +692,6 @@
"event_20200820_cn": "復刻鐵血音符誓言", "event_20200820_cn": "復刻鐵血音符誓言",
"event_20201012_cn": "劃破海空之翼", "event_20201012_cn": "劃破海空之翼",
"event_20210527_cn": "鏡位螺旋", "event_20210527_cn": "鏡位螺旋",
"event_20220526_cn": "Pledge of the Radiant Court",
"raid_20200624": "特別演習埃塞克斯級(復刻)", "raid_20200624": "特別演習埃塞克斯級(復刻)",
"event_20220428_cn": "Rondo at Rainbows End", "event_20220428_cn": "Rondo at Rainbows End",
"event_20220414_cn": "Aurora Noctis Rerun", "event_20220414_cn": "Aurora Noctis Rerun",

View File

@@ -21,6 +21,8 @@ VALID_CHANNEL_PACKAGE = {
'com.bilibili.blhx.nearme.gamecenter': ('cn', 'oppo'), 'com.bilibili.blhx.nearme.gamecenter': ('cn', 'oppo'),
'com.bilibili.blhx.vivo': ('cn', 'vivo'), 'com.bilibili.blhx.vivo': ('cn', 'vivo'),
'com.bilibili.blhx.mz': ('cn', '魅族'), 'com.bilibili.blhx.mz': ('cn', '魅族'),
'com.bilibili.blhx.dl': ('cn', '当乐'),
'com.bilibili.blhx.lenovo': ('cn', '联想'),
# 'com.bilibili.blhx.letv': ('cn', '乐视'), # Not confirmed # 'com.bilibili.blhx.letv': ('cn', '乐视'), # Not confirmed
# 'com.bilibili.blhx.gionee': ('cn', '金立'), # Not confirmed # 'com.bilibili.blhx.gionee': ('cn', '金立'), # Not confirmed
@@ -29,6 +31,7 @@ VALID_CHANNEL_PACKAGE = {
'com.bilibili.blhx.mzw': ('cn', '拇指玩'), 'com.bilibili.blhx.mzw': ('cn', '拇指玩'),
'com.yiwu.blhx.yx15': ('cn', '一五游戏'), 'com.yiwu.blhx.yx15': ('cn', '一五游戏'),
'com.bilibili.blhx.m4399': ('cn', '4399'), 'com.bilibili.blhx.m4399': ('cn', '4399'),
'com.bilibili.blhx.bilibiliMove': ('cn', '迁移'),
# Tw # Tw
'com.hkmanjuu.azurlane.gp.mc': ('tw', 'MyCard'), 'com.hkmanjuu.azurlane.gp.mc': ('tw', 'MyCard'),

View File

@@ -13,7 +13,7 @@ from adbutils.errors import AdbError
from module.base.decorator import Config, cached_property, del_cached_property from module.base.decorator import Config, cached_property, del_cached_property
from module.base.utils import ensure_time from module.base.utils import ensure_time
from module.config.server import VALID_CHANNEL_PACKAGE, set_server from module.config.server import VALID_CHANNEL_PACKAGE, VALID_PACKAGE, set_server
from module.device.connection_attr import ConnectionAttr from module.device.connection_attr import ConnectionAttr
from module.device.method.utils import (PackageNotInstalled, RETRY_TRIES, get_serial_pair, handle_adb_error, from module.device.method.utils import (PackageNotInstalled, RETRY_TRIES, get_serial_pair, handle_adb_error,
possible_reasons, random_port, recv_all, remove_shell_warning, retry_sleep) possible_reasons, random_port, recv_all, remove_shell_warning, retry_sleep)
@@ -803,7 +803,7 @@ class Connection(ConnectionAttr):
list[str]: List of package names list[str]: List of package names
""" """
packages = self.list_package(show_log=show_log) packages = self.list_package(show_log=show_log)
packages = [p for p in packages if p in VALID_CHANNEL_PACKAGE or p in VALID_CHANNEL_PACKAGE] packages = [p for p in packages if p in VALID_PACKAGE or p in VALID_CHANNEL_PACKAGE]
return packages return packages
def detect_package(self, set_config=True): def detect_package(self, set_config=True):

View File

@@ -74,7 +74,7 @@ def insert_swipe(p0, p3, speed=15, min_distance=10):
prev = (-100, -100) prev = (-100, -100)
for t in ts: for t in ts:
point = p0 * (1 - t) ** 3 + 3 * p1 * t * (1 - t) ** 2 + 3 * p2 * t ** 2 * (1 - t) + p3 * t ** 3 point = p0 * (1 - t) ** 3 + 3 * p1 * t * (1 - t) ** 2 + 3 * p2 * t ** 2 * (1 - t) + p3 * t ** 3
point = point.astype(np.int).tolist() point = point.astype(int).tolist()
if np.linalg.norm(np.subtract(point, prev)) < min_distance: if np.linalg.norm(np.subtract(point, prev)) < min_distance:
continue continue

View File

@@ -234,6 +234,11 @@ class RewardGacha(GachaUI, GeneralShop, Retirement):
if confirm_timer.reached(): if confirm_timer.reached():
break break
# Wishing pool no longer shows coins, go back to normal pools
if self.appear(BUILD_SUBMIT_WW_ORDERS):
logger.info('In wishing pool, go back to normal pools')
self.gacha_side_navbar_ensure(upper=1)
def gacha_submit(self, skip_first_screenshot=True): def gacha_submit(self, skip_first_screenshot=True):
""" """
Pages: Pages:

View File

@@ -508,7 +508,7 @@ class Fleet(Camera, AmbushHandler):
if self.fleet_2_location: if self.fleet_2_location:
self.map[self.fleet_2_location].is_fleet = True self.map[self.fleet_2_location].is_fleet = True
location_dict = {} location_dict = {}
if self.config.FLEET_2: if self.fleet_2_location:
location_dict[2] = self.fleet_2_location location_dict[2] = self.fleet_2_location
location_dict[1] = self.fleet_1_location location_dict[1] = self.fleet_1_location
# Release fortress block # Release fortress block

View File

@@ -147,7 +147,7 @@ def match_movable(before, spawn, after, fleets, fleet_step=2):
after = after + fleets after = after + fleets
x = len(after) x = len(after)
y = len(before) y = len(before)
distance = np.ones((y, x), dtype=np.int) * base_weight distance = np.ones((y, x), dtype=int) * base_weight
for i1, g1 in enumerate(before): for i1, g1 in enumerate(before):
for i2, g2 in enumerate(after): for i2, g2 in enumerate(after):
distance[i1, i2] = fleet_step - sum(abs(np.subtract(g1, g2))) distance[i1, i2] = fleet_step - sum(abs(np.subtract(g1, g2)))

View File

@@ -245,7 +245,8 @@ class MetaReward(Combat, UI):
# If dossier beacon is not enabled, or MetaReward is invoked # If dossier beacon is not enabled, or MetaReward is invoked
# by AshBeaconAssist, do not need to check dossier # by AshBeaconAssist, do not need to check dossier
if self.has_possible_dossier_reward(is_dossier=dossier): if self.has_possible_dossier_reward(is_dossier=dossier):
self.search_for_dossier_reward() # self.search_for_dossier_reward()
logger.info('Dossier meta reward receiving feature is temporarily disabled by the developer. \nPlease receive it by yourself for the time.')
else: else:
logger.info('MetaReward is called by current beacon, skip dossier reward check') logger.info('MetaReward is called by current beacon, skip dossier reward check')
return return

View File

@@ -10,8 +10,9 @@ class OSConfig:
IGNORE_LOW_EMOTION_WARN = False IGNORE_LOW_EMOTION_WARN = False
MAP_GRID_CENTER_TOLERANCE = 0.2 MAP_GRID_CENTER_TOLERANCE = 0.2
MAP_SWIPE_MULTIPLY = (1.320, 1.009) MAP_SWIPE_MULTIPLY = (1.174, 1.200)
MAP_SWIPE_MULTIPLY_MINITOUCH = (1.276, 0.974) MAP_SWIPE_MULTIPLY_MINITOUCH = (1.135, 1.160)
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.102, 1.126)
DETECTION_BACKEND = 'perspective' DETECTION_BACKEND = 'perspective'
MID_DIFF_RANGE_H = (103 - 3, 103 + 3) MID_DIFF_RANGE_H = (103 - 3, 103 + 3)

View File

@@ -323,6 +323,10 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh):
if self.handle_os_game_tips(): if self.handle_os_game_tips():
confirm_timer.reset() confirm_timer.reset()
continue continue
if self.is_in_map_order():
self.order_quit()
confirm_timer.reset()
continue
# Combat # Combat
if self.combat_appear(): if self.combat_appear():

View File

@@ -86,7 +86,7 @@ class GlobeCamera(GlobeOperation, ZoneManager):
bool: if camera moved. bool: if camera moved.
""" """
name = 'GLOBE_SWIPE_' + '_'.join([str(int(round(x))) for x in vector]) name = 'GLOBE_SWIPE_' + '_'.join([str(int(round(x))) for x in vector])
if np.any(np.abs(vector) > 25): if np.linalg.norm(vector) > 25:
if self.config.DEVICE_CONTROL_METHOD == 'minitouch': if self.config.DEVICE_CONTROL_METHOD == 'minitouch':
distance = self.config.MAP_SWIPE_MULTIPLY_MINITOUCH distance = self.config.MAP_SWIPE_MULTIPLY_MINITOUCH
elif self.config.DEVICE_CONTROL_METHOD == 'MaaTouch': elif self.config.DEVICE_CONTROL_METHOD == 'MaaTouch':
@@ -100,6 +100,8 @@ class GlobeCamera(GlobeOperation, ZoneManager):
self.device.sleep(0.3) self.device.sleep(0.3)
self.globe_update() self.globe_update()
else:
logger.warning(f'Globe swipe to short: {vector}, dropped')
def globe_wait_until_stable(self): def globe_wait_until_stable(self):
prev = self.globe_camera prev = self.globe_camera
@@ -164,8 +166,7 @@ class GlobeCamera(GlobeOperation, ZoneManager):
area = (400, 200, GLOBE_MAP_SHAPE[0] - 400, GLOBE_MAP_SHAPE[1] - 250) area = (400, 200, GLOBE_MAP_SHAPE[0] - 400, GLOBE_MAP_SHAPE[1] - 250)
loca = point_limit(zone.location, area=area) loca = point_limit(zone.location, area=area)
vector = np.array(loca) - self.globe_camera vector = np.array(loca) - self.globe_camera
# TODO: Yeah, 0.8 multiplier is shit, better implement needed vector = vector / self.config.OS_GLOBE_SWIPE_MULTIPLY
vector = vector * 0.8 / self.config.OS_GLOBE_SWIPE_MULTIPLY
swipe = tuple(np.min([np.abs(vector), swipe_limit], axis=0) * np.sign(vector)) swipe = tuple(np.min([np.abs(vector), swipe_limit], axis=0) * np.sign(vector))
self.globe_swipe(swipe) self.globe_swipe(swipe)

View File

@@ -826,8 +826,8 @@ class OSMap(OSFleet, Map, GlobeCamera, StrategicSearchHandler):
self.handle_info_bar() self.handle_info_bar()
self.update() self.update()
if self.map_rescan_current(drop=drop): if self.map_rescan_current(drop=drop):
logger.info(f'Map rescan once end, result={result}') logger.info(f'Map rescan once end, result={True}')
return result return True
if rescan_mode == 'full': if rescan_mode == 'full':
logger.hr('Map rescan full', level=2) logger.hr('Map rescan full', level=2)

View File

@@ -401,12 +401,12 @@ class OperationSiren(OSMap):
self.get_current_zone() self.get_current_zone()
# Preset action point to 100 # Preset action point to 70
# When running CL1 oil is for running CL1, not meowfficer farming # When running CL1 oil is for running CL1, not meowfficer farming
keep_current_ap = True keep_current_ap = True
if self.config.OpsiGeneral_BuyActionPointLimit > 0: if self.config.OpsiGeneral_BuyActionPointLimit > 0:
keep_current_ap = False keep_current_ap = False
self.action_point_set(cost=100, keep_current_ap=keep_current_ap, check_rest_ap=True) self.action_point_set(cost=70, keep_current_ap=keep_current_ap, check_rest_ap=True)
if self._action_point_total >= 3000: if self._action_point_total >= 3000:
with self.config.multi_set(): with self.config.multi_set():
self.config.task_delay(server_update=True) self.config.task_delay(server_update=True)
@@ -442,13 +442,6 @@ class OperationSiren(OSMap):
logger.info(f'Delay task `{task}` to {next_run}') logger.info(f'Delay task `{task}` to {next_run}')
self.config.cross_set(keys=keys, value=next_run) self.config.cross_set(keys=keys, value=next_run)
# ResetActionPointPreserve
# Unbound attribute, default to 500
preserve = self.config.OpsiMeowfficerFarming_ActionPointPreserve
logger.info(f'Set OpsiMeowfficerFarming.ActionPointPreserve to {preserve}')
self.config.cross_set(
keys='OpsiMeowfficerFarming.OpsiMeowfficerFarming.ActionPointPreserve', value=preserve)
def _os_explore(self): def _os_explore(self):
""" """
Explore all dangerous zones at the beginning of month. Explore all dangerous zones at the beginning of month.

View File

@@ -171,7 +171,7 @@ class Radar:
for y in range(*self.shape[1]): for y in range(*self.shape[1]):
if np.linalg.norm([x, y]) > radius: if np.linalg.norm([x, y]) > radius:
continue continue
grid_center = np.round(delta * (x, y) + center).astype(np.int) grid_center = np.round(delta * (x, y) + center).astype(int)
self.grids[(x, y)] = RadarGrid(location=(x, y), image=None, center=grid_center, config=self.config) self.grids[(x, y)] = RadarGrid(location=(x, y), image=None, center=grid_center, config=self.config)
def __iter__(self): def __iter__(self):

View File

@@ -27,8 +27,8 @@ class StrategicSearchHandler(MapEventHandler):
self.device.click(STRATEGIC_SEARCH_MAP_OPTION_OFF) self.device.click(STRATEGIC_SEARCH_MAP_OPTION_OFF)
continue continue
def strategic_search_set_option(self, skip_first_screenshot=False): def strategic_search_set_tab(self, skip_first_screenshot=False):
logger.info('Strategic search set option') logger.info('Strategic search set tab')
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
skip_first_screenshot = False skip_first_screenshot = False
@@ -39,9 +39,17 @@ class StrategicSearchHandler(MapEventHandler):
self.device.click(STRATEGIC_SEARCH_TAB_SECURED) self.device.click(STRATEGIC_SEARCH_TAB_SECURED)
continue continue
if get_color(self.device.image, STRATEGIC_SEARCH_TAB_SECURED.area)[2] > 150: if get_color(self.device.image, STRATEGIC_SEARCH_TAB_SECURED.area)[2] > 150:
skip_first_screenshot = True
break break
def strategic_search_set_option(self, skip_first_screenshot=True):
"""
Args:
skip_first_screenshot:
Returns:
If success. False if strategic settings closed for unknown reason.
"""
logger.info('Strategic search set option')
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
skip_first_screenshot = False skip_first_screenshot = False
@@ -64,6 +72,9 @@ class StrategicSearchHandler(MapEventHandler):
STRATEGIC_SEARCH_SCROLL.drag_threshold = 0.1 STRATEGIC_SEARCH_SCROLL.drag_threshold = 0.1
STRATEGIC_SEARCH_SCROLL.set(0.5, main=self) STRATEGIC_SEARCH_SCROLL.set(0.5, main=self)
if not STRATEGIC_SEARCH_SCROLL.appear(main=self):
return False
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
skip_first_screenshot = False skip_first_screenshot = False
@@ -86,6 +97,9 @@ class StrategicSearchHandler(MapEventHandler):
STRATEGIC_SEARCH_SCROLL.drag_threshold = 0.05 STRATEGIC_SEARCH_SCROLL.drag_threshold = 0.05
STRATEGIC_SEARCH_SCROLL.edge_add = (0.5, 0.8) STRATEGIC_SEARCH_SCROLL.edge_add = (0.5, 0.8)
STRATEGIC_SEARCH_SCROLL.set_bottom(main=self) STRATEGIC_SEARCH_SCROLL.set_bottom(main=self)
if not STRATEGIC_SEARCH_SCROLL.appear(main=self):
return False
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
skip_first_screenshot = False skip_first_screenshot = False
@@ -104,6 +118,8 @@ class StrategicSearchHandler(MapEventHandler):
logger.attr('auto_submit', 'on') logger.attr('auto_submit', 'on')
break break
return True
def strategic_search_confirm(self, skip_first_screenshot=False): def strategic_search_confirm(self, skip_first_screenshot=False):
logger.info('Strategic search confirm') logger.info('Strategic search confirm')
while 1: while 1:
@@ -121,11 +137,22 @@ class StrategicSearchHandler(MapEventHandler):
def strategic_search_start(self, skip_first_screenshot=False): def strategic_search_start(self, skip_first_screenshot=False):
""" """
Returns:
If success.
Pages: Pages:
in: IN_MAP in: IN_MAP
out: IN_MAP, with strategic search running out: IN_MAP, with strategic search running
""" """
logger.hr('Strategic search start') logger.hr('Strategic search start')
self.strategy_search_enter(skip_first_screenshot=skip_first_screenshot) for _ in range(3):
self.strategic_search_set_option(skip_first_screenshot=True) self.strategy_search_enter(skip_first_screenshot=skip_first_screenshot)
self.strategic_search_confirm(skip_first_screenshot=True) self.strategic_search_set_tab(skip_first_screenshot=True)
success = self.strategic_search_set_option(skip_first_screenshot=True)
if not success:
continue
self.strategic_search_confirm(skip_first_screenshot=True)
return True
logger.warning('Failed to start strategic search')
return False

View File

@@ -129,8 +129,8 @@ page_main.link(button=MAIN_GOTO_EVENT_LIST, destination=page_event_list)
# Raid # Raid
page_raid = Page(RAID_CHECK) page_raid = Page(RAID_CHECK)
page_raid.link(button=GOTO_MAIN, destination=page_main) # page_raid.link(button=GOTO_MAIN, destination=page_main)
page_main.link(button=MAIN_GOTO_RAID, destination=page_raid) # page_main.link(button=MAIN_GOTO_RAID, destination=page_raid)
# Research # Research
# Please don't goto page_research from page_reward. # Please don't goto page_research from page_reward.