StarRailCopilot/README_en.md

152 lines
6.3 KiB
Markdown
Raw Permalink Normal View History

# AzurLaneAutoScript
Alas, an Azur Lane automation tool with GUI (For CN server, can support other server).
![gui](doc/README.assets/gui_en.png)
2020-05-30 19:10:10 +00:00
## Features
2020-05-30 19:10:10 +00:00
- **Campaign**: Currently support the first 6 chapter and 7-2
2020-05-30 19:10:10 +00:00
- **Events**: Support「Skybound Oratorio」, specifically map D1 and D3, supporting handling of 光之壁? (Fleet is unable to proceed into square that has 光之壁. Support 开荒)
2020-05-30 19:10:10 +00:00
- **Daily Mission**: Able to finish everything in 30 minutes, repeated run will skip over what has been done on that day
2020-05-30 19:10:10 +00:00
Daily Mission(Submarine not support). Hardmode(Currently only support 10-4). Exercise, Auto SL.
- **Events x3 PT**: 30 minutes to finish A1-B3
2020-05-30 19:10:10 +00:00
- **Commissions**: Dispatch commision every 20 minutes during campaign, accept commission rewards, research rewards, and daily mission rewards.
2020-05-30 19:10:10 +00:00
- **Misc Features**
2020-05-30 19:10:10 +00:00
Morale Control, Calculate Morale to prevent it from going sad, or to maintain Morale to earn experience
2020-05-30 19:10:10 +00:00
HP Monitoring, Low HP Retire, Frontline HP Balancing
2020-05-30 19:10:10 +00:00
Equipment Change
2020-05-31 07:07:23 +00:00
Periodic Screeshot Record
2020-05-30 19:10:10 +00:00
Auto Retire
2020-05-31 07:07:23 +00:00
Map completion mode, when running new map, it will try to do 3 star clear
2020-05-30 19:10:10 +00:00
## Installation
2020-05-30 19:10:10 +00:00
- Clone this item
2020-05-30 19:10:10 +00:00
- Installing dependacy using a virutal enviroment
```
pip install -r requirements.txt
```
2020-05-30 19:10:10 +00:00
| Device | Emulator Version | Android Version | ADB Screenshot | UIAutomator2 Screenshot | ADB Click | UIAutomator2 Click |
| ---------- | ---------- | -------- | ------- | ------ | ------- | ------ |
| NemuPlayer | 7.1.3 | 5.1.1 | 0.308 | 0.275 | 0.294 | 0.146 |
| LDPlayer | 3.83 | 5.1.1 | 0.329 | 0.313 | 0.291 | 0.146 |
| NoxPlayer | 6.6.0.0 | 5.1.1 | 0.339 | 0.313 | 0.505 | 0.141 |
| MuMuPlayer | 2.3.1.0 | 6.0.1 | 0.368 | 0.701 | 0.358 | 0.148 |
| Oneplus5 | | 7.1.1 | 1.211 | 0.285 | 0.447 | 0.160 |
2020-05-30 19:10:10 +00:00
This are the common emulation setting that we have tested on, tested Platform Windows 10, I7-8700K, 1080ti, nvme SSD, emulator resolution 1280x720, Azur Lane 60FPS, tested on map 7-2, on average execute 100 commands in seconds.
2020-05-30 19:10:10 +00:00
As screenshot recognition has a high requirement needed to run, AzurLaneAutoScript currently does not support mobile devices, you MUST use an emulator.
2020-05-30 19:10:10 +00:00
- Install an Android emulator
- Set emulator resolution to 1280x720
2020-05-30 19:10:10 +00:00
### ADB Setup
2020-05-30 19:10:10 +00:00
- Install [ADB](https://developer.android.com/studio/releases/platform-tools)
- Add ADB to enviroment variables of the system and test wheather the configurationis successful using the below command
```
adb devices
```
2020-05-30 19:10:10 +00:00
### Installing UIAutomator2
2020-05-30 19:10:10 +00:00
[UIAutomator2](https://github.com/openatx/uiautomator2), is a library for automation, it can be use to speedup screenshots and clicks. `AzurLaneAutoScript` can also use ADB to perform screenshots and clicks, but it will be slightly slower.
2020-05-30 19:10:10 +00:00
For performance optimisation, it is recommended to use ADB for screenshot, and UIautomator2 for clicks. (As U2 Screenshot is slightly faster compare to ADB screenshot, but CPU resource usage is doubled, while U2 click is superior in all ways compare to ADB)
2020-05-30 19:10:10 +00:00
- Starting up
```
python -m uiautomator2 init
```
2020-05-30 19:10:10 +00:00
All connected devices will be install with [uiautomator-server](https://github.com/openatx/android-uiautomator-server/releases) , [atx-agent](https://github.com/openatx/atx-agent), [minicap](https://github.com/openstf/minicap), [minitouch](https://github.com/openstf/minitouch)
. If the device is a emulator, UIautomator2 will skip over the installation of minicap.
2020-05-30 19:10:10 +00:00
- Check if the installation of UIautomator 2 is successful
2020-05-30 19:10:10 +00:00
Modify the serial in \dev_tools\emulator_test.py line 31 and, execute from root project directory (the same where you have the file alas.py)
The default serial for some emulators:
| Device | serial |
| ---------- | --------------- |
| NoxPlayer | 127.0.0.1:62001 |
| MuMuPlayer | 127.0.0.1:7555 |
| NemuPlayer | 127.0.0.1:21503 |
| LDPlayer | emulator-5554 |
2020-05-30 19:10:10 +00:00
## Usage
- Double-click alas.pyw to run via graphical interface (GUI)
- (Not Recommeneded) to run alas.pyw throught cmd even thought Alas is using [Gooey](https://github.com/chriskiehl/Gooey) a library that converts the command line to a GUI, Alas didnt have a method for running command line before using gooey. Alas was meant to be use with gooey, as such the command line function was create hastily. Therefore, using command line to run Alas will not be easy.
- (Not Recommended) to modify the configuration file 'config'alas.ini' and relation function in 'alas.py'
- Multi-usage: copy alas.pyw, and rename, double-click run on it. The settings of template.ini are copied when the first run runs. The script runtime uses the ini profile of the same name.
2020-05-30 19:10:10 +00:00
## Known issue
2020-05-30 19:10:10 +00:00
Sort by frequency
2020-05-30 19:10:10 +00:00
- **GUI move slowly, UIautomator2 move slowly**
- **Unable to deal with network issues** Reconnect pop-up, little chick pop-up
- **It will display green face, yellow face, red face** This is a bug, Alas will restart the game every 2 hour to update the affections level.
- **Exercise may fail SL**
- **Under rare circumstance ABD and UIAutomator2 will have convulsive seizures**
- **Screen draging will not work in rare circumstances**
2020-05-30 19:10:10 +00:00
## Doc
[Map Perspective](doc/perspective.md)
2020-05-30 19:10:10 +00:00
`Map Perspective` is the core foundation of Azur scripts. If you simply use (Template Matching) to search for enemies, it is inevitable that in some rare cases, the BOSS will be blocked by mobs. `AzurLaneAutoScript` provides a better map recognition menthod in `module.map`, you will be able to get a more complete sea information such as:
```
2020-03-10 22:09:03.830 | INFO | A B C D E F G H
2020-03-10 22:09:03.830 | INFO | 1 -- ++ 2E -- -- -- -- --
2020-03-10 22:09:03.830 | INFO | 2 -- ++ ++ MY -- -- 2E --
2020-03-10 22:09:03.830 | INFO | 3 == -- FL -- -- -- 2E MY
2020-03-10 22:09:03.830 | INFO | 4 -- == -- -- -- -- ++ ++
2020-03-10 22:09:03.830 | INFO | 5 -- -- -- 2E -- 2E ++ ++
```
2020-05-30 19:10:10 +00:00
[Development](doc/development.md)
- How to add a button
- How to adapt to a new map
- How to support other server/language
2020-05-30 19:10:10 +00:00
## Reference
- (Not open source) http://asaiq2.lofter.com/
2020-05-30 19:14:04 +00:00
Ready made Azur scripts that has high completetion rate. Refer to the main functions and settings.
- https://github.com/Egoistically/ALAuto
(Archived) https://github.com/perryhuynh/azurlane-auto
2020-05-30 19:14:04 +00:00
EN Server script, use to mimic server architect.