1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-25 02:30:09 +08:00

Merge pull request #67 from LmeSzinc/master

Fix: Increase retry interval in commission start for slow device
This commit is contained in:
Erik
2020-07-13 17:21:05 -03:00
committed by GitHub
15 changed files with 119 additions and 111 deletions

View File

@@ -57,14 +57,16 @@ JP support, Thanks **[@ferina8-14](https://github.com/ferina8-14)**, some featur
详见 [中文安装教程](doc/Installation_cn.md) 详见 [中文安装教程](doc/Installation_cn.md)
包含傻瓜式安装教程和高级用户安装教程. 包含傻瓜式安装教程, 傻瓜式更新教程和高级用户安装教程.
## 使用注意事项 Note ## 使用注意事项 Note
- 模拟器分辨率需要为 1280 x 720. - 模拟器分辨率需要为 1280 x 720.
- 需要关闭`开发者选项-输入-指针位置(屏幕叠加层显示当前触摸数据)`, 因为这会遮挡模拟器内的游戏画面.
- 当修改完设置后, 需要点击 `开始` 来保存选项, 然后点击 `编辑` 返回主界面. 因为位于左侧的每一项功能都是分别保存和运行的. - 当修改完设置后, 需要点击 `开始` 来保存选项, 然后点击 `编辑` 返回主界面. 因为位于左侧的每一项功能都是分别保存和运行的.
- 当你的图打到一半的时候, 需要手动打完或者手动撤退, 再启动 Alas.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -81,4 +81,4 @@ class Campaign(CampaignBase):
if self.clear_roadblocks([road_main]): if self.clear_roadblocks([road_main]):
return True return True
return self.fleet_1.clear_boss() return self.fleet_2.clear_boss()

View File

@@ -49,23 +49,23 @@ step_on = SelectedGrids([C3])
road_boss = RoadGrids([C3, H4, [C5, C7], G6, G8]) road_boss = RoadGrids([C3, H4, [C5, C7], G6, G8])
class Config: class Config:
pass
# INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 INTERNAL_LINES_HOUGHLINES_THRESHOLD = 35
# EDGE_LINES_HOUGHLINES_THRESHOLD = 40 EDGE_LINES_HOUGHLINES_THRESHOLD = 35
# COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.3
# INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
# 'height': (150, 255 - 24), 'height': (150, 255 - 24),
# 'width': (0.9, 10), 'width': (0.9, 10),
# 'prominence': 10, 'prominence': 10,
# 'distance': 35, 'distance': 35,
# } }
# EDGE_LINES_FIND_PEAKS_PARAMETERS = { EDGE_LINES_FIND_PEAKS_PARAMETERS = {
# 'height': (255 - 24, 255), 'height': (255 - 24, 255),
# 'prominence': 10, 'prominence': 10,
# 'distance': 50, 'distance': 50,
# 'width': (0, 10), 'width': (0, 10),
# 'wlen': 1000, 'wlen': 1000,
# } }
class Campaign(CampaignBase): class Campaign(CampaignBase):

View File

@@ -3,7 +3,7 @@ import os
# os.chdir('../') # os.chdir('../')
import module.config.server as server import module.config.server as server
server.server = 'cn' # Don't need to edit, it's used to avoid error. server.server = 'cn' # Edit server here.
print(os.getcwd()) print(os.getcwd())
import numpy as np import numpy as np
@@ -199,6 +199,9 @@ class Items:
def get_data(self): def get_data(self):
return [[self.timestamp, self.status_timestamp, self.enemy, item.name, item.amount] for item in self.items] return [[self.timestamp, self.status_timestamp, self.enemy, item.name, item.amount] for item in self.items]
"""
Edit server at the top of this file first.
"""
""" """
These code is for testing These code is for testing

View File

@@ -32,7 +32,8 @@ class MapData:
self.name = data['name'] self.name = data['name']
self.profiles = data['profiles'] self.profiles = data['profiles']
self.map_id = data['id'] self.map_id = data['id']
self.spawn_data = [{'battle': index} for index in range(data['boss_refresh'] + 1)] battle_count = max(data['boss_refresh'], max(data['enemy_refresh'].keys()))
self.spawn_data = [{'battle': index} for index in range(battle_count + 1)]
try: try:
# spawn_data # spawn_data
for index, count in data['enemy_refresh'].items(): for index, count in data['enemy_refresh'].items():
@@ -189,6 +190,8 @@ class ChapterTemplate:
list(MapData): list(MapData):
""" """
print('<<< SEARCH MAP >>>') print('<<< SEARCH MAP >>>')
name = name.strip()
name = int(name) if name.isdigit() else name
print(f'Searching: {name}') print(f'Searching: {name}')
if isinstance(name, str): if isinstance(name, str):
maps = [] maps = []
@@ -236,8 +239,8 @@ class ChapterTemplate:
folder (str): folder (str):
""" """
print('<<< CONFIRM >>>') print('<<< CONFIRM >>>')
print('Please confirm selected the right maps, before extracting. Will skip existing files.\n' print('Please confirm selected the correct maps before extracting. Will skip existing files.\n'
'Press ENTER to continue') 'Input any key and press ENTER to continue')
input() input()
if not os.path.exists(folder): if not os.path.exists(folder):

View File

@@ -28,6 +28,7 @@ EXP_INFO_D = Button(area={'cn': (377, 42, 393, 137), 'en': (377, 42, 393, 137),
EXP_INFO_S = Button(area={'cn': (396, 122, 457, 137), 'en': (396, 122, 457, 137), 'jp': (396, 122, 457, 137)}, color={'cn': (233, 241, 127), 'en': (233, 241, 127), 'jp': (233, 241, 127)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/EXP_INFO_S.png', 'en': './assets/en/combat/EXP_INFO_S.png', 'jp': './assets/jp/combat/EXP_INFO_S.png'}) EXP_INFO_S = Button(area={'cn': (396, 122, 457, 137), 'en': (396, 122, 457, 137), 'jp': (396, 122, 457, 137)}, color={'cn': (233, 241, 127), 'en': (233, 241, 127), 'jp': (233, 241, 127)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/EXP_INFO_S.png', 'en': './assets/en/combat/EXP_INFO_S.png', 'jp': './assets/jp/combat/EXP_INFO_S.png'})
GET_ITEMS_1 = Button(area={'cn': (538, 217, 741, 253), 'en': (550, 215, 739, 246), 'jp': (539, 220, 741, 252)}, color={'cn': (160, 192, 248), 'en': (157, 187, 233), 'jp': (146, 184, 249)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/GET_ITEMS_1.png', 'en': './assets/en/combat/GET_ITEMS_1.png', 'jp': './assets/jp/combat/GET_ITEMS_1.png'}) GET_ITEMS_1 = Button(area={'cn': (538, 217, 741, 253), 'en': (550, 215, 739, 246), 'jp': (539, 220, 741, 252)}, color={'cn': (160, 192, 248), 'en': (157, 187, 233), 'jp': (146, 184, 249)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/GET_ITEMS_1.png', 'en': './assets/en/combat/GET_ITEMS_1.png', 'jp': './assets/jp/combat/GET_ITEMS_1.png'})
GET_ITEMS_2 = Button(area={'cn': (538, 146, 742, 182), 'en': (549, 140, 740, 176), 'jp': (536, 146, 741, 182)}, color={'cn': (160, 192, 248), 'en': (152, 185, 236), 'jp': (145, 182, 249)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/GET_ITEMS_2.png', 'en': './assets/en/combat/GET_ITEMS_2.png', 'jp': './assets/jp/combat/GET_ITEMS_2.png'}) GET_ITEMS_2 = Button(area={'cn': (538, 146, 742, 182), 'en': (549, 140, 740, 176), 'jp': (536, 146, 741, 182)}, color={'cn': (160, 192, 248), 'en': (152, 185, 236), 'jp': (145, 182, 249)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/GET_ITEMS_2.png', 'en': './assets/en/combat/GET_ITEMS_2.png', 'jp': './assets/jp/combat/GET_ITEMS_2.png'})
GET_ITEMS_3 = Button(area={'cn': (539, 143, 742, 179), 'en': (548, 136, 740, 172), 'jp': (539, 143, 742, 179)}, color={'cn': (161, 193, 248), 'en': (152, 185, 237), 'jp': (161, 193, 248)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/GET_ITEMS_3.png', 'en': './assets/en/combat/GET_ITEMS_3.png', 'jp': './assets/cn/combat/GET_ITEMS_3.png'})
GET_SHIP = Button(area={'cn': (1104, 610, 1110, 630), 'en': (1104, 610, 1110, 630), 'jp': (1104, 610, 1110, 630)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/GET_SHIP.png', 'en': './assets/en/combat/GET_SHIP.png', 'jp': './assets/jp/combat/GET_SHIP.png'}) GET_SHIP = Button(area={'cn': (1104, 610, 1110, 630), 'en': (1104, 610, 1110, 630), 'jp': (1104, 610, 1110, 630)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255)}, button={'cn': (1000, 631, 1055, 689), 'en': (999, 630, 1047, 691), 'jp': (1000, 631, 1055, 689)}, file={'cn': './assets/cn/combat/GET_SHIP.png', 'en': './assets/en/combat/GET_SHIP.png', 'jp': './assets/jp/combat/GET_SHIP.png'})
LOADING_BAR = Button(area={'cn': (33, 676, 1247, 680), 'en': (33, 676, 1247, 680), 'jp': (33, 676, 1247, 680)}, color={'cn': (172, 205, 232), 'en': (172, 205, 232), 'jp': (172, 205, 232)}, button={'cn': (33, 676, 1247, 680), 'en': (33, 676, 1247, 680), 'jp': (33, 676, 1247, 680)}, file={'cn': './assets/cn/combat/LOADING_BAR.png', 'en': './assets/en/combat/LOADING_BAR.png', 'jp': './assets/jp/combat/LOADING_BAR.png'}) LOADING_BAR = Button(area={'cn': (33, 676, 1247, 680), 'en': (33, 676, 1247, 680), 'jp': (33, 676, 1247, 680)}, color={'cn': (172, 205, 232), 'en': (172, 205, 232), 'jp': (172, 205, 232)}, button={'cn': (33, 676, 1247, 680), 'en': (33, 676, 1247, 680), 'jp': (33, 676, 1247, 680)}, file={'cn': './assets/cn/combat/LOADING_BAR.png', 'en': './assets/en/combat/LOADING_BAR.png', 'jp': './assets/jp/combat/LOADING_BAR.png'})
MOVE_DOWN = Button(area={'cn': (148, 647, 155, 669), 'en': (148, 647, 155, 669), 'jp': (148, 647, 155, 669)}, color={'cn': (21, 28, 57), 'en': (21, 28, 57), 'jp': (21, 28, 57)}, button={'cn': (148, 647, 155, 669), 'en': (148, 647, 155, 669), 'jp': (148, 647, 155, 669)}, file={'cn': './assets/cn/combat/MOVE_DOWN.png', 'en': './assets/en/combat/MOVE_DOWN.png', 'jp': './assets/jp/combat/MOVE_DOWN.png'}) MOVE_DOWN = Button(area={'cn': (148, 647, 155, 669), 'en': (148, 647, 155, 669), 'jp': (148, 647, 155, 669)}, color={'cn': (21, 28, 57), 'en': (21, 28, 57), 'jp': (21, 28, 57)}, button={'cn': (148, 647, 155, 669), 'en': (148, 647, 155, 669), 'jp': (148, 647, 155, 669)}, file={'cn': './assets/cn/combat/MOVE_DOWN.png', 'en': './assets/en/combat/MOVE_DOWN.png', 'jp': './assets/jp/combat/MOVE_DOWN.png'})

View File

@@ -3,7 +3,6 @@ from module.exercise.assets import *
from module.exercise.equipment import ExerciseEquipment from module.exercise.equipment import ExerciseEquipment
from module.exercise.hp_daemon import HpDaemon from module.exercise.hp_daemon import HpDaemon
from module.exercise.opponent import OpponentChoose, OPPONENT from module.exercise.opponent import OpponentChoose, OPPONENT
from module.ui.assets import BACK_ARROW
class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment): class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment):
@@ -102,8 +101,8 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment):
index (int): From left to right. 0 to 3. index (int): From left to right. 0 to 3.
""" """
logger.hr('Opponent: %s' % str(index)) logger.hr('Opponent: %s' % str(index))
opponent_timer = Timer(1) opponent_timer = Timer(5)
preparation_timer = Timer(1) preparation_timer = Timer(5)
while 1: while 1:
self.device.screenshot() self.device.screenshot()

View File

@@ -6,7 +6,7 @@ from module.exercise.assets import *
class ExerciseEquipment(Equipment): class ExerciseEquipment(Equipment):
def _active_edit(self): def _active_edit(self):
timer = Timer(1) timer = Timer(5)
while 1: while 1:
self.device.screenshot() self.device.screenshot()
@@ -19,7 +19,7 @@ class ExerciseEquipment(Equipment):
break break
def _inactive_edit(self): def _inactive_edit(self):
timer = Timer(1) timer = Timer(5)
while 1: while 1:
self.device.screenshot() self.device.screenshot()

View File

@@ -119,16 +119,16 @@ class Retirement(Enhancement):
if self.config.RETIRE_SR or self.config.RETIRE_SSR or self.config.RETIREMENT_METHOD == 'one_click_retire': if self.config.RETIRE_SR or self.config.RETIRE_SSR or self.config.RETIREMENT_METHOD == 'one_click_retire':
if self.handle_popup_confirm(): if self.handle_popup_confirm():
continue continue
if self.appear_then_click(SHIP_CONFIRM, offset=30, interval=2): if self.appear_then_click(SHIP_CONFIRM, offset=(30, 30), interval=2):
continue continue
if self.appear_then_click(SHIP_CONFIRM_2, offset=30, interval=2): if self.appear_then_click(SHIP_CONFIRM_2, offset=(30, 30), interval=2):
continue continue
if self.appear_then_click(EQUIP_CONFIRM, offset=30, interval=2): if self.appear_then_click(EQUIP_CONFIRM, offset=(30, 30), interval=2):
continue continue
if self.appear_then_click(EQUIP_CONFIRM_2, offset=30, interval=2): if self.appear_then_click(EQUIP_CONFIRM_2, offset=(30, 30), interval=2):
executed = True executed = True
continue continue
if self.appear(GET_ITEMS_1, interval=0.5): if self.appear(GET_ITEMS_1, offset=(30, 30)):
self.device.click(GET_ITEMS_1_RETIREMENT_SAVE) self.device.click(GET_ITEMS_1_RETIREMENT_SAVE)
self.interval_reset(SHIP_CONFIRM) self.interval_reset(SHIP_CONFIRM)
continue continue

View File

@@ -489,7 +489,7 @@ class RewardCommission(UI, InfoHandler):
comm (Commission): comm (Commission):
""" """
logger.info(f'Start commission {comm}') logger.info(f'Start commission {comm}')
comm_timer = Timer(3) comm_timer = Timer(10)
while 1: while 1:
if comm_timer.reached(): if comm_timer.reached():
self.device.click(comm.button) self.device.click(comm.button)
@@ -498,10 +498,10 @@ class RewardCommission(UI, InfoHandler):
if self.handle_popup_confirm(): if self.handle_popup_confirm():
comm_timer.reset() comm_timer.reset()
pass pass
if self.appear_then_click(COMMISSION_START, interval=3): if self.appear_then_click(COMMISSION_ADVICE, interval=3):
comm_timer.reset() comm_timer.reset()
pass pass
if self.appear_then_click(COMMISSION_ADVICE, interval=3): if self.appear_then_click(COMMISSION_START, interval=3):
comm_timer.reset() comm_timer.reset()
pass pass

View File

@@ -76,7 +76,7 @@ class Reward(RewardCommission, RewardTacticalClass, LoginHandler, Update):
while 1: while 1:
self.device.screenshot() self.device.screenshot()
for button in [EXP_INFO_S_REWARD, GET_ITEMS_1, GET_ITEMS_2, GET_SHIP]: for button in [EXP_INFO_S_REWARD, GET_ITEMS_1, GET_ITEMS_2, GET_ITEMS_3, GET_SHIP]:
if self.appear(button, interval=1): if self.appear(button, interval=1):
REWARD_SAVE_CLICK.name = button.name REWARD_SAVE_CLICK.name = button.name
self.device.click(REWARD_SAVE_CLICK) self.device.click(REWARD_SAVE_CLICK)