diff --git a/README_en.md b/README_en.md index 18641a0ef..13d5c2558 100644 --- a/README_en.md +++ b/README_en.md @@ -18,7 +18,7 @@ Star Rail Instant Tea, a bot for Honkai: Star Rail, based on the next generation ## Install [![](https://img.shields.io/github/downloads/LmeSzinc/StarRailCopilot/total?color=4e4c97)](https://github.com/LmeSzinc/StarRailCopilot/releases) -Refers to [Installation tutorial](https://github.com/LmeSzinc/StarRailCopilot/wiki/Installation_cn), including easy-installer manual, use manual, manual installation tutorial. +Refers to [Installation tutorial](https://github.com/LmeSzinc/StarRailCopilot/wiki/Installation_en), including easy-installer manual, use manual, manual installation tutorial. > **Why use emulators?** If you run a bot on the desktop client, game windows must stay at front. I guess you don't wanna baby-sit there without being able to move the mouse and keyboard while running the bot, so use the emulators. @@ -28,7 +28,7 @@ Refers to [Installation tutorial](https://github.com/LmeSzinc/StarRailCopilot/wi ## Development -Discord https://discord.gg/aJkt3mKDEr QQ Group 752620927 +Discord https://discord.gg/aJkt3mKDEr - [Minimap Tracking](https://github.com/LmeSzinc/StarRailCopilot/wiki/MinimapTracking) diff --git a/README_es.md b/README_es.md index 20932d498..6b80be23e 100644 --- a/README_es.md +++ b/README_es.md @@ -12,14 +12,14 @@ Star Rail Copilot, un bot para Honkai: Star Rail, basado en la siguiente generac - **Farmeo automático AFK**: El bot lo hace todo de manera automática, abre los emuladores, completa las misiones y realiza las tareas diarias. ## Instalación [![](https://img.shields.io/github/downloads/LmeSzinc/StarRailCopilot/total?color=4e4c97)](https://github.com/LmeSzinc/StarRailCopilot/releases) -Dirígete a la [Guía de Instalación](https://github.com/LmeSzinc/StarRailCopilot/wiki/Installation_cn) para consultar cómo hacer la instalación automática, el manual de uso, etc. +Dirígete a la [Guía de Instalación](https://github.com/LmeSzinc/StarRailCopilot/wiki/Installation_en) para consultar cómo hacer la instalación automática, el manual de uso, etc. > **¿Por qué usar un emulador?** Si ejecutas el bot en la versión de escritorio, la ventana debe de estar al frente. Imagino que no quieres quedarte esperando sin poder mover el ratón y teclado mientras el bot se ejecuta. Por esto se usa emulador. > **¿Cómo es el rendimiento?** Con un 8700k + 1080 Ti y usando el emulador MuMu12 con los gráficos en Muy Alto, se obtienen 40 FPS. No debería ser un problema ejecutar el juego en gráficos al máximo y tener 60 FPS si tienes un PC más nuevo. ## Desarrollo -Discord: https://discord.gg/aJkt3mKDEr | Grupo de QQ: 752620927 +Discord: https://discord.gg/aJkt3mKDEr - [Seguimiento del Minimapa](https://github.com/LmeSzinc/StarRailCopilot/wiki/MinimapTracking) - Documentación para desarrolladores (el menú está en la barra lateral): [Wiki de ALAS](https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/1.-Start) (en Chino). Sin embargo, hay un montón de código nuevo, por lo que es recomendado leer el código fuente y el historial de commits. diff --git a/assets/character/Guinaifen.png b/assets/character/Guinaifen.png new file mode 100644 index 000000000..777b2c3a3 Binary files /dev/null and b/assets/character/Guinaifen.png differ diff --git a/assets/character/TopazandNumby.png b/assets/character/TopazandNumby.png new file mode 100644 index 000000000..6313e85a0 Binary files /dev/null and b/assets/character/TopazandNumby.png differ diff --git a/assets/share/combat/interact/MAP_LOADING.SEARCH.png b/assets/share/combat/interact/MAP_LOADING.SEARCH.png new file mode 100644 index 000000000..9a1c84aa5 Binary files /dev/null and b/assets/share/combat/interact/MAP_LOADING.SEARCH.png differ diff --git a/assets/share/combat/interact/MAP_LOADING.png b/assets/share/combat/interact/MAP_LOADING.png new file mode 100644 index 000000000..c8b993d63 Binary files /dev/null and b/assets/share/combat/interact/MAP_LOADING.png differ diff --git a/doc/README.assets/gui_es.png b/doc/README.assets/gui_es.png index 0705af565..b5c85cbc9 100644 Binary files a/doc/README.assets/gui_es.png and b/doc/README.assets/gui_es.png differ diff --git a/module/base/resource.py b/module/base/resource.py index fd9d7cd58..69156aa27 100644 --- a/module/base/resource.py +++ b/module/base/resource.py @@ -81,5 +81,11 @@ def release_resources(next_task=''): # logger.info(f'Release {obj}') obj.resource_release() + # If no task, check in-game text language again at next run + # cause user may change it + if not next_task: + from tasks.base.main_page import MainPage + MainPage._lang_checked = False + # Useless in most cases, but just call it # gc.collect() diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 1f0e7d073..9e8cd5039 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -354,6 +354,7 @@ "DanHengImbibitorLunae", "FuXuan", "Gepard", + "Guinaifen", "Herta", "Himeko", "Hook", @@ -373,6 +374,7 @@ "SilverWolf", "Sushang", "Tingyun", + "TopazandNumby", "TrailblazerDestruction", "TrailblazerPreservation", "Welt", diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 30956f01b..e8314608e 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -53,7 +53,7 @@ class GeneratedConfig: # Group `DungeonSupport` DungeonSupport_Use = 'when_daily' # always_use, when_daily, do_not_use - DungeonSupport_Character = 'FirstCharacter' # FirstCharacter, Arlan, Asta, Bailu, Blade, Bronya, Clara, DanHeng, DanHengImbibitorLunae, FuXuan, Gepard, Herta, Himeko, Hook, JingYuan, Jingliu, Kafka, Luka, Luocha, Lynx, March7th, Natasha, Pela, Qingque, Sampo, Seele, Serval, SilverWolf, Sushang, Tingyun, TrailblazerDestruction, TrailblazerPreservation, Welt, Yanqing, Yukong + DungeonSupport_Character = 'FirstCharacter' # FirstCharacter, Arlan, Asta, Bailu, Blade, Bronya, Clara, DanHeng, DanHengImbibitorLunae, FuXuan, Gepard, Guinaifen, Herta, Himeko, Hook, JingYuan, Jingliu, Kafka, Luka, Luocha, Lynx, March7th, Natasha, Pela, Qingque, Sampo, Seele, Serval, SilverWolf, Sushang, Tingyun, TopazandNumby, TrailblazerDestruction, TrailblazerPreservation, Welt, Yanqing, Yukong # Group `DungeonStorage` DungeonStorage_TrailblazePower = {} diff --git a/module/config/config_updater.py b/module/config/config_updater.py index 4c7b3b8ea..fc283ba8c 100644 --- a/module/config/config_updater.py +++ b/module/config/config_updater.py @@ -91,7 +91,7 @@ class ConfigGenerator: options=[dungeon.name for dungeon in DungeonList.instances.values() if dungeon.is_Echo_of_War]) # Insert characters from tasks.character.keywords import CharacterList - unsupported_characters = ["Guinaifen", "TopazandNumby"] + unsupported_characters = [] characters = [character.name for character in CharacterList.instances.values() if character.name not in unsupported_characters] option_add(keys='DungeonSupport.Character.option', options=characters) @@ -599,7 +599,8 @@ class ConfigUpdater: value = deep_get(old, keys=keys, default=data['value']) typ = data['type'] display = data.get('display') - if is_template or value is None or value == '' or typ == 'lock' or (display == 'hide' and typ != 'stored'): + if is_template or value is None or value == '' \ + or typ in ['lock', 'state'] or (display == 'hide' and typ != 'stored'): value = data['value'] value = parse_value(value, data=data) deep_set(new, keys=keys, value=value) diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index ad5bad717..a40c3aa11 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -366,6 +366,7 @@ "DanHengImbibitorLunae": "Dan Heng • Imbibitor Lunae", "FuXuan": "Fu Xuan", "Gepard": "Gepard", + "Guinaifen": "Guinaifen", "Herta": "Herta", "Himeko": "Himeko", "Hook": "Hook", @@ -385,6 +386,7 @@ "SilverWolf": "Silver Wolf", "Sushang": "Sushang", "Tingyun": "Tingyun", + "TopazandNumby": "Topaz and Numby", "TrailblazerDestruction": "Trailblazer Destruction", "TrailblazerPreservation": "Trailblazer Preservation", "Welt": "Welt", diff --git a/module/config/i18n/es-ES.json b/module/config/i18n/es-ES.json index 899b1cdb1..58dbbe99f 100644 --- a/module/config/i18n/es-ES.json +++ b/module/config/i18n/es-ES.json @@ -366,6 +366,7 @@ "DanHengImbibitorLunae": "Dan Heng - Imbibitor Lunae", "FuXuan": "Fu Xuan", "Gepard": "Gepard", + "Guinaifen": "Guinaifen", "Herta": "Herta", "Himeko": "Himeko", "Hook": "Hook", @@ -385,6 +386,7 @@ "SilverWolf": "Silver Wolf", "Sushang": "Sushang", "Tingyun": "Tingyun", + "TopazandNumby": "Topaz y Conti", "TrailblazerDestruction": "Trailblazer de Destrucción", "TrailblazerPreservation": "Trailblazer de Conservación", "Welt": "Welt", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index d26b6c720..bd48a3857 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -366,6 +366,7 @@ "DanHengImbibitorLunae": "丹恒・飲月", "FuXuan": "符玄", "Gepard": "ジェパード", + "Guinaifen": "桂乃芬", "Herta": "ヘルタ", "Himeko": "姫子", "Hook": "フック", @@ -385,6 +386,7 @@ "SilverWolf": "銀狼", "Sushang": "素裳", "Tingyun": "停雲", + "TopazandNumby": "トパーズ&カブ", "TrailblazerDestruction": "開拓者・壊滅", "TrailblazerPreservation": "開拓者・存護", "Welt": "ヴェルト", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 52d76882e..3a4f986a0 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -366,6 +366,7 @@ "DanHengImbibitorLunae": "丹恒•饮月", "FuXuan": "符玄", "Gepard": "杰帕德", + "Guinaifen": "桂乃芬", "Herta": "黑塔", "Himeko": "姬子", "Hook": "虎克", @@ -385,6 +386,7 @@ "SilverWolf": "银狼", "Sushang": "素裳", "Tingyun": "停云", + "TopazandNumby": "托帕&账账", "TrailblazerDestruction": "开拓者•毁灭", "TrailblazerPreservation": "开拓者•存护", "Welt": "瓦尔特", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 834ebf938..dcafd45d9 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -366,6 +366,7 @@ "DanHengImbibitorLunae": "丹恆•飲月", "FuXuan": "符玄", "Gepard": "傑帕德", + "Guinaifen": "桂乃芬", "Herta": "黑塔", "Himeko": "姬子", "Hook": "虎克", @@ -385,6 +386,7 @@ "SilverWolf": "銀狼", "Sushang": "素裳", "Tingyun": "停雲", + "TopazandNumby": "托帕&帳帳", "TrailblazerDestruction": "開拓者•毀滅", "TrailblazerPreservation": "開拓者•存護", "Welt": "瓦爾特", diff --git a/tasks/base/ui.py b/tasks/base/ui.py index 0a50017c9..da63c2312 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -8,6 +8,7 @@ from tasks.base.assets.assets_base_page import CLOSE, MAP_EXIT from tasks.base.main_page import MainPage from tasks.base.page import Page, page_main from tasks.combat.assets.assets_combat_finish import COMBAT_EXIT +from tasks.combat.assets.assets_combat_interact import MAP_LOADING from tasks.combat.assets.assets_combat_prepare import COMBAT_PREPARE from tasks.daily.assets.assets_daily_trial import INFO_CLOSE from tasks.login.assets.assets_login import LOGIN_CONFIRM @@ -79,6 +80,19 @@ class UI(MainPage): if self.ui_additional(): timeout.reset() continue + if self.handle_popup_single(): + timeout.reset() + continue + if self.handle_popup_confirm(): + timeout.reset() + continue + if self.appear_then_click(LOGIN_CONFIRM, interval=5): + timeout.reset() + continue + if self.appear(MAP_LOADING, interval=5): + logger.info('Map loading') + timeout.reset() + continue app_check() minicap_check() @@ -138,13 +152,13 @@ class UI(MainPage): continue # Additional + if self.ui_additional(): + continue if self.handle_popup_single(): continue if self.handle_popup_confirm(): continue - if self.ui_additional(): - continue - if self.appear_then_click(LOGIN_CONFIRM): + if self.appear_then_click(LOGIN_CONFIRM, interval=5): continue # Reset connection diff --git a/tasks/combat/assets/assets_combat_interact.py b/tasks/combat/assets/assets_combat_interact.py index 0feaece7e..5b575ed58 100644 --- a/tasks/combat/assets/assets_combat_interact.py +++ b/tasks/combat/assets/assets_combat_interact.py @@ -13,3 +13,13 @@ DUNGEON_COMBAT_INTERACT = ButtonWrapper( button=(750, 411, 997, 448), ), ) +MAP_LOADING = ButtonWrapper( + name='MAP_LOADING', + share=Button( + file='./assets/share/combat/interact/MAP_LOADING.png', + area=(644, 367, 662, 389), + search=(639, 347, 667, 394), + color=(159, 141, 149), + button=(644, 367, 662, 389), + ), +) diff --git a/tasks/combat/interact.py b/tasks/combat/interact.py index d2521cae0..5d60b3c1c 100644 --- a/tasks/combat/interact.py +++ b/tasks/combat/interact.py @@ -1,5 +1,7 @@ +from module.base.utils import color_similar, get_color from tasks.base.ui import UI -from tasks.combat.assets.assets_combat_interact import DUNGEON_COMBAT_INTERACT +from tasks.combat.assets.assets_combat_interact import DUNGEON_COMBAT_INTERACT, MAP_LOADING +from tasks.map.assets.assets_map_control import A_BUTTON class CombatInteract(UI): @@ -12,3 +14,15 @@ class CombatInteract(UI): return True return False + + def is_map_loading(self): + if self.appear(MAP_LOADING, similarity=0.75): + return True + + return False + + def is_map_loading_black(self): + color = get_color(self.device.image, A_BUTTON.area) + if color_similar(color, (0, 0, 0)): + return True + return False