Merge remote-tracking branch 'origin/master'

This commit is contained in:
LmeSzinc 2020-06-16 18:34:26 +08:00
commit 20567ceba5
17 changed files with 112 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,83 @@
from module.campaign.campaign_base import CampaignBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
MAP = CampaignMap('12-4')
MAP.shape = 'K8'
MAP.map_data = '''
MB MB ME -- ME ++ ++ ++ MB MB ++
ME ++ -- ME -- MA ++ ++ 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 SP SP ++ ++ ++ ME --
'''
MAP.weight_data = '''
10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 20
10 10 10 10 10 10 10 10 10 10 20
10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 10
'''
MAP.camera_data = ['D3', 'D6', 'H3', 'H6']
MAP.spawn_data = [
{'battle': 0, 'enemy': 2},
{'battle': 1, 'enemy': 2},
{'battle': 2, 'enemy': 2},
{'battle': 3, 'enemy': 1},
{'battle': 4, 'enemy': 1},
{'battle': 5},
{'battle': 6, 'boss': 1},
]
# MAP.in_map_swipe_preset_data = (2, 1)
A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, \
A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, \
A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, \
A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, \
A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, \
A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, \
A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, \
A8, B8, C8, D8, E8, F8, G8, H8, I8, J8, K8, \
= MAP.flatten()
# ROAD_MAIN = RoadGrids([[B6, C5]])
road_main = RoadGrids([[B6, C5]])
class Config:
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
'height': (120, 255 - 40),
'width': 2,
'prominence': 10,
'distance': 35,
}
class Campaign(CampaignBase):
MAP = MAP
def battle_0(self):
if self.clear_roadblocks([road_main]):
return True
if self.clear_potential_roadblocks([road_main]):
return True
return self.battle_default()
def battle_6(self):
self.pick_up_ammo()
boss = self.map.select(is_boss=True)
if boss:
if not self.check_accessibility(boss[0], fleet=1):
if self.clear_roadblocks([road_main]):
return True
return self.fleet_1.clear_boss()

View File

@ -15,6 +15,7 @@ A5, B5, C5, D5, E5, F5, G5, H5 = MAP.flatten()
ROAD_MAIN = RoadGrids([A3, [C3, B4, C5], [F1, G2, G3]])
GRIDS_FOR_FASTER = SelectedGrids([A3, C3, E3, G3])
FLEET_2_STEP_ON = SelectedGrids([A3, G3, C3, E3])
# MAP.camera_data_spawn_point = ['A1']
class Campaign(CampaignBase):

11
doc/Getting_Started.md Normal file
View File

@ -0,0 +1,11 @@
# Getting Started
* When opening the ALAS GUI you will see a number of different functions on the left side. `Setting` and `Reward` are where you can configure how the script runs. In `Setting` you can choose which fleet is the mob fleet or the boss fleet, retirement and enhancing preferences and you even choose what level of ship morale you would like to farm with. In `Reward` you set when the script will collect oil and coins from your canteen and market and mission rewards. You can also tell the script what commissions you would like to run and what tactical training to do. All of the settings here will be used when you select a `function` to farm. Before choosing a `function` to farm, please press `start` to save your `settings`, so if you go to `function` `setting` and modify some things and dont click in `start` nothing there you change will be write on `alas.ini`, and not run ALAS with `alas.ini` opened, this can cause issues when saving changes to the file.
* The current functions are `Daily` where the script will run your daily missions and hard mode maps of your choice. `Main Campaign` where the script will complete story stages. `Event` where it will run event maps. `7-2 Mystery Farming` will run 7-2 to farm for gold. `12-2 and 12-4 Levelling` will run those maps for exp.
* After you have tweaked your settings and saved them, select a function and press start again and the script will run. For example if you select the `event` function, then press start it will farm an event map of your choice.
* Dont use submarines, When switching the submarine zone, the icon in the strategy don't change because a in-game bug, it's not just to checking `do_not_use` in ALAS, dont have any submarine fleet mounted while using the ALAS.

View File

@ -9,9 +9,9 @@
* The use of a virtual environment (venv) in python is highly recommended
* ADB debugging enabled and emulator with 1280x720 resolution
* **Read the entire guide before asking any questions.**
*
# New installation method
# New installation method (Recommended)
* Just download the file [EasyALAS_CLICK_INSTALL.bat](https://raw.githubusercontent.com/whoamikyo/AzurLaneAutoScript/master/EasyALAS_CLICK_INSTALL.bat), put in some folder and run as administrator (`Right click> Run as administrator`)
* Then it will install everything and download ALAS

7
doc/Readme.md Normal file
View File

@ -0,0 +1,7 @@
# Documentation
Here are some documents to help both beginners and advanced users.
Before asking any questions, make sure that your question has not been answered in any document.
Feel free to add new information through the pull request.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -52,7 +52,7 @@ def update_config_from_template(config, file):
@Gooey(
optional_cols=2,
program_name=pyw_name.capitalize(),
program_name=pyw_name.capitalize(), image_dir='doc/misc.assets',
sidebar_title='功能',
terminal_font_family='Consolas',
language='chinese',

View File

@ -50,7 +50,7 @@ def update_config_from_template(config, file):
@Gooey(
optional_cols=2,
program_name=pyw_name.capitalize(),
program_name=pyw_name.capitalize(), image_dir='doc/misc.assets',
sidebar_title='Function',
terminal_font_family='Consolas',
language='english',
@ -121,7 +121,7 @@ def main(ini_name=''):
setting_parser = subs.add_parser('setting')
# 选择关卡
stage = setting_parser.add_argument_group('Level settings', 'Need to run once to save options')
stage = setting_parser.add_argument_group('Level settings', 'Need to Press start to save your settings.')
stage.add_argument('--enable_stop_condition', default=default('--enable_stop_condition'), choices=['yes', 'no'])
stage.add_argument('--enable_fast_forward', default=default('--enable_fast_forward'), choices=['yes', 'no'], help='Enable or disable clearing mode')
@ -218,7 +218,7 @@ def main(ini_name=''):
# ==========reward==========
reward_parser = subs.add_parser('reward')
reward_condition = reward_parser.add_argument_group('Triggering conditions', 'Need to run once to save the options, after running it will enter the on-hook vegetable collection mode')
reward_condition = reward_parser.add_argument_group('Triggering conditions', 'Need to Press start to save your settings, after running it will enter the on-hook vegetable collection mode')
reward_condition.add_argument('--enable_reward', default=default('--enable_reward'), choices=['yes', 'no'])
reward_condition.add_argument('--reward_interval', default=default('--reward_interval'), choices=['20', '30', '60'], help='How many minutes to trigger collection')
@ -269,7 +269,7 @@ def main(ini_name=''):
# ==========emulator==========
emulator_parser = subs.add_parser('emulator')
emulator = emulator_parser.add_argument_group('Emulator', 'Need to run once to save the options, it will check whether the game is started \nIf the game has not started, it will be started')
emulator = emulator_parser.add_argument_group('Emulator', 'Need to Press start to save your settings, it will check whether the game is started \nIf the game has not started, it will be started')
emulator.add_argument('--serial', default=default('--serial'), help='Bluestacks 127.0.0.1:5555 \nNox 127.0.0.1:62001')
emulator.add_argument('--package_name', default='com.YoStarEN.AzurLane', help='')

View File

@ -49,7 +49,7 @@ def update_config_from_template(config, file):
@Gooey(
optional_cols=2,
program_name=pyw_name.capitalize(),
program_name=pyw_name.capitalize(), image_dir='doc/misc.assets',
sidebar_title='Function',
terminal_font_family='Consolas',
language='english',

View File

@ -30,7 +30,7 @@ MAP_AMBUSH = Button(area={'cn': (261, 433, 1280, 449), 'en': (261, 433, 1280, 44
MAP_AMBUSH_EVADE = Button(area={'cn': (325, 393, 1280, 395), 'en': (325, 393, 1280, 395), 'jp': (325, 393, 1280, 395)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255)}, button={'cn': (979, 444, 1152, 502), 'en': (978, 443, 1153, 503), 'jp': (979, 444, 1152, 502)}, file={'cn': './assets/cn/handler/MAP_AMBUSH_EVADE.png', 'en': './assets/en/handler/MAP_AMBUSH_EVADE.png', 'jp': './assets/jp/handler/MAP_AMBUSH_EVADE.png'})
MAP_BUFF = Button(area={'cn': (145, 115, 437, 159), 'en': (145, 115, 437, 159), 'jp': (145, 115, 437, 159)}, color={'cn': (103, 118, 118), 'en': (103, 118, 118), 'jp': (103, 118, 118)}, button={'cn': (145, 115, 437, 159), 'en': (145, 115, 437, 159), 'jp': (145, 115, 437, 159)}, file={'cn': './assets/cn/handler/MAP_BUFF.png', 'en': './assets/en/handler/MAP_BUFF.png', 'jp': './assets/jp/handler/MAP_BUFF.png'})
MAP_CLEAR_PERCENTAGE = Button(area={'cn': (626, 185, 970, 190), 'en': (626, 185, 970, 190), 'jp': (626, 185, 970, 190)}, color={'cn': (245, 213, 88), 'en': (245, 213, 88), 'jp': (245, 213, 88)}, button={'cn': (626, 185, 970, 190), 'en': (626, 185, 970, 190), 'jp': (626, 185, 970, 190)}, file={'cn': './assets/cn/handler/MAP_CLEAR_PERCENTAGE.png', 'en': './assets/en/handler/MAP_CLEAR_PERCENTAGE.png', 'jp': './assets/jp/handler/MAP_CLEAR_PERCENTAGE.png'})
MAP_ENEMY_SEARCHING = Button(area={'cn': (531, 320, 864, 382), 'en': (531, 320, 864, 382), 'jp': (608, 325, 785, 368)}, color={'cn': (200, 99, 91), 'en': (200, 99, 91), 'jp': (242, 136, 130)}, button={'cn': (531, 320, 864, 382), 'en': (531, 320, 864, 382), 'jp': (608, 325, 785, 368)}, file={'cn': './assets/cn/handler/MAP_ENEMY_SEARCHING.png', 'en': './assets/en/handler/MAP_ENEMY_SEARCHING.png', 'jp': './assets/jp/handler/MAP_ENEMY_SEARCHING.png'})
MAP_ENEMY_SEARCHING = Button(area={'cn': (531, 320, 864, 382), 'en': (531, 320, 864, 382), 'jp': (608, 325, 785, 368)}, color={'cn': (200, 99, 91), 'en': (174, 122, 83), 'jp': (242, 136, 130)}, button={'cn': (531, 320, 864, 382), 'en': (531, 320, 864, 382), 'jp': (608, 325, 785, 368)}, file={'cn': './assets/cn/handler/MAP_ENEMY_SEARCHING.png', 'en': './assets/en/handler/MAP_ENEMY_SEARCHING.png', 'jp': './assets/jp/handler/MAP_ENEMY_SEARCHING.png'})
MAP_GREEN = Button(area={'cn': (195, 260, 349, 292), 'en': (201, 259, 341, 290), 'jp': (242, 265, 323, 287)}, color={'cn': (125, 190, 84), 'en': (104, 207, 104), 'jp': (143, 196, 109)}, button={'cn': (195, 260, 349, 292), 'en': (201, 259, 341, 290), 'jp': (242, 265, 323, 287)}, file={'cn': './assets/cn/handler/MAP_GREEN.png', 'en': './assets/en/handler/MAP_GREEN.png', 'jp': './assets/jp/handler/MAP_GREEN.png'})
MAP_STAR_1 = Button(area={'cn': (245, 377, 254, 384), 'en': (232, 381, 240, 389), 'jp': (239, 377, 244, 387)}, color={'cn': (251, 233, 143), 'en': (252, 234, 146), 'jp': (230, 203, 119)}, button={'cn': (245, 377, 254, 384), 'en': (232, 381, 240, 389), 'jp': (239, 377, 244, 387)}, file={'cn': './assets/cn/handler/MAP_STAR_1.png', 'en': './assets/en/handler/MAP_STAR_1.png', 'jp': './assets/jp/handler/MAP_STAR_1.png'})
MAP_STAR_2 = Button(area={'cn': (532, 377, 540, 384), 'en': (518, 382, 526, 389), 'jp': (526, 377, 531, 387)}, color={'cn': (251, 233, 144), 'en': (252, 234, 144), 'jp': (229, 204, 120)}, button={'cn': (532, 377, 540, 384), 'en': (518, 382, 526, 389), 'jp': (526, 377, 531, 387)}, file={'cn': './assets/cn/handler/MAP_STAR_2.png', 'en': './assets/en/handler/MAP_STAR_2.png', 'jp': './assets/jp/handler/MAP_STAR_2.png'})

View File

@ -66,7 +66,7 @@ class EnemySearchingHandler(InfoHandler):
if appeared:
self.handle_enemy_flashing()
self.device.sleep(0.3)
logger.info('In map.')
logger.info('Enemy searching appeared.')
break
self.enemy_searching_color_initial()
if timeout.reached():