Merge pull request #9 from LmeSzinc/master

Fix: Enhance failed turn to retry retire when mood notice popup
This commit is contained in:
Erik 2020-06-01 15:15:02 -03:00 committed by GitHub
commit 595193fa50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 6 deletions

View File

@ -3,9 +3,11 @@
[English Readme](README_en.md) `Translation in progress`
# AzurLaneAutoScript
Alas, an Azur Lane automation tool with GUI (For CN server, can support other server).
Alas, an Azur Lane automation tool with GUI (Support CN and EN, can support other server).
Alas, 一个带GUI的碧蓝航线脚本 (支持国服, 可以支持其他服务器).
Alas, 一个带GUI的碧蓝航线脚本 (支持国服和国际服, 可以支持其他服务器).
EN support, Thanks **[@whoamikyo](https://github.com/whoamikyo)**
![gui](doc/README.assets/gui.png)
@ -126,10 +128,11 @@ python -m uiautomator2 init
## 使用方法 Usage
- 双击 alas.pyw, 通过图形界面(GUI)运行
- 编辑`alas.bat`, 并双击运行
- 创建快捷方式, 把目标修改为`<绝对路径至python虚拟环境> <绝对路径至alas.pyw>`, 把起始位置修改为 `<绝对路径至AzurLaneAutoScript的目录>`, 双击运行
- (不推荐) 通过命令行运行. 虽然alas使用了 [Gooey](https://github.com/chriskiehl/Gooey), 一个将命令行转为GUI的库, 但是Alas并不是先有命令行方法运行再用gooey的, Alas是为了使用gooey快速编写GUI而去拼凑命令行参数的. 因此使用命令行会很难受.
- (不推荐) 修改配置文件 `config/alas.ini` , 在 `alas.py` 中调用相关函数
- 多开运行, 复制 alas.pyw, 并重命名, 双击运行即可. 首次运行时会复制template.ini的设置. 脚本运行时会使用同名的ini配置文件.
- 多开运行, 复制 alas.pyw, 并重命名. 首次运行时会复制template.ini的设置. 脚本运行时会使用同名的ini配置文件.

View File

@ -50,6 +50,8 @@ class Combat(HPBalancer, EnemySearchingHandler, Retirement, SubmarineCall, Comba
continue
if self.handle_combat_low_emotion():
continue
if self.handle_retirement():
continue
# Break
if self.combat_appear():

View File

@ -247,13 +247,15 @@ class Retirement(Enhancement):
self._unable_to_enhance = False
if not total:
logger.warning('No ship retired, exit')
raise ScriptError('No ship retired, exit')
logger.info('This may happens because wrong options of one click retirement in game')
exit(1)
elif 'retire' in self.config.RETIREMENT_METHOD or self._unable_to_enhance:
total = self._retire_handler()
self._unable_to_enhance = False
if not total:
logger.warning('No ship retired, exit')
raise ScriptError('No ship retired, exit')
logger.info('This may happens because some filters are set in dock')
exit(1)
else:
total = self._enhance_handler()
if not total: