Merge pull request #180 from LmeSzinc/bug_fix

Bug fix
This commit is contained in:
LmeSzinc 2023-10-30 02:40:13 +08:00 committed by GitHub
commit d0238d920c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 68 additions and 11 deletions

View File

@ -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) ## 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. > **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 ## Development
Discord https://discord.gg/aJkt3mKDEr QQ Group 752620927 Discord https://discord.gg/aJkt3mKDEr
- [Minimap Tracking](https://github.com/LmeSzinc/StarRailCopilot/wiki/MinimapTracking) - [Minimap Tracking](https://github.com/LmeSzinc/StarRailCopilot/wiki/MinimapTracking)

View File

@ -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. - **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) ## 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. > **¿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. > **¿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 ## 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) - [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. - 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -81,5 +81,11 @@ def release_resources(next_task=''):
# logger.info(f'Release {obj}') # logger.info(f'Release {obj}')
obj.resource_release() 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 # Useless in most cases, but just call it
# gc.collect() # gc.collect()

View File

@ -354,6 +354,7 @@
"DanHengImbibitorLunae", "DanHengImbibitorLunae",
"FuXuan", "FuXuan",
"Gepard", "Gepard",
"Guinaifen",
"Herta", "Herta",
"Himeko", "Himeko",
"Hook", "Hook",
@ -373,6 +374,7 @@
"SilverWolf", "SilverWolf",
"Sushang", "Sushang",
"Tingyun", "Tingyun",
"TopazandNumby",
"TrailblazerDestruction", "TrailblazerDestruction",
"TrailblazerPreservation", "TrailblazerPreservation",
"Welt", "Welt",

View File

@ -53,7 +53,7 @@ class GeneratedConfig:
# Group `DungeonSupport` # Group `DungeonSupport`
DungeonSupport_Use = 'when_daily' # always_use, when_daily, do_not_use 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` # Group `DungeonStorage`
DungeonStorage_TrailblazePower = {} DungeonStorage_TrailblazePower = {}

View File

@ -91,7 +91,7 @@ class ConfigGenerator:
options=[dungeon.name for dungeon in DungeonList.instances.values() if dungeon.is_Echo_of_War]) options=[dungeon.name for dungeon in DungeonList.instances.values() if dungeon.is_Echo_of_War])
# Insert characters # Insert characters
from tasks.character.keywords import CharacterList from tasks.character.keywords import CharacterList
unsupported_characters = ["Guinaifen", "TopazandNumby"] unsupported_characters = []
characters = [character.name for character in CharacterList.instances.values() characters = [character.name for character in CharacterList.instances.values()
if character.name not in unsupported_characters] if character.name not in unsupported_characters]
option_add(keys='DungeonSupport.Character.option', options=characters) option_add(keys='DungeonSupport.Character.option', options=characters)
@ -599,7 +599,8 @@ class ConfigUpdater:
value = deep_get(old, keys=keys, default=data['value']) value = deep_get(old, keys=keys, default=data['value'])
typ = data['type'] typ = data['type']
display = data.get('display') 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 = data['value']
value = parse_value(value, data=data) value = parse_value(value, data=data)
deep_set(new, keys=keys, value=value) deep_set(new, keys=keys, value=value)

View File

@ -366,6 +366,7 @@
"DanHengImbibitorLunae": "Dan Heng • Imbibitor Lunae", "DanHengImbibitorLunae": "Dan Heng • Imbibitor Lunae",
"FuXuan": "Fu Xuan", "FuXuan": "Fu Xuan",
"Gepard": "Gepard", "Gepard": "Gepard",
"Guinaifen": "Guinaifen",
"Herta": "Herta", "Herta": "Herta",
"Himeko": "Himeko", "Himeko": "Himeko",
"Hook": "Hook", "Hook": "Hook",
@ -385,6 +386,7 @@
"SilverWolf": "Silver Wolf", "SilverWolf": "Silver Wolf",
"Sushang": "Sushang", "Sushang": "Sushang",
"Tingyun": "Tingyun", "Tingyun": "Tingyun",
"TopazandNumby": "Topaz and Numby",
"TrailblazerDestruction": "Trailblazer Destruction", "TrailblazerDestruction": "Trailblazer Destruction",
"TrailblazerPreservation": "Trailblazer Preservation", "TrailblazerPreservation": "Trailblazer Preservation",
"Welt": "Welt", "Welt": "Welt",

View File

@ -366,6 +366,7 @@
"DanHengImbibitorLunae": "Dan Heng - Imbibitor Lunae", "DanHengImbibitorLunae": "Dan Heng - Imbibitor Lunae",
"FuXuan": "Fu Xuan", "FuXuan": "Fu Xuan",
"Gepard": "Gepard", "Gepard": "Gepard",
"Guinaifen": "Guinaifen",
"Herta": "Herta", "Herta": "Herta",
"Himeko": "Himeko", "Himeko": "Himeko",
"Hook": "Hook", "Hook": "Hook",
@ -385,6 +386,7 @@
"SilverWolf": "Silver Wolf", "SilverWolf": "Silver Wolf",
"Sushang": "Sushang", "Sushang": "Sushang",
"Tingyun": "Tingyun", "Tingyun": "Tingyun",
"TopazandNumby": "Topaz y Conti",
"TrailblazerDestruction": "Trailblazer de Destrucción", "TrailblazerDestruction": "Trailblazer de Destrucción",
"TrailblazerPreservation": "Trailblazer de Conservación", "TrailblazerPreservation": "Trailblazer de Conservación",
"Welt": "Welt", "Welt": "Welt",

View File

@ -366,6 +366,7 @@
"DanHengImbibitorLunae": "丹恒・飲月", "DanHengImbibitorLunae": "丹恒・飲月",
"FuXuan": "符玄", "FuXuan": "符玄",
"Gepard": "ジェパード", "Gepard": "ジェパード",
"Guinaifen": "桂乃芬",
"Herta": "ヘルタ", "Herta": "ヘルタ",
"Himeko": "姫子", "Himeko": "姫子",
"Hook": "フック", "Hook": "フック",
@ -385,6 +386,7 @@
"SilverWolf": "銀狼", "SilverWolf": "銀狼",
"Sushang": "素裳", "Sushang": "素裳",
"Tingyun": "停雲", "Tingyun": "停雲",
"TopazandNumby": "トパーズ&カブ",
"TrailblazerDestruction": "開拓者・壊滅", "TrailblazerDestruction": "開拓者・壊滅",
"TrailblazerPreservation": "開拓者・存護", "TrailblazerPreservation": "開拓者・存護",
"Welt": "ヴェルト", "Welt": "ヴェルト",

View File

@ -366,6 +366,7 @@
"DanHengImbibitorLunae": "丹恒•饮月", "DanHengImbibitorLunae": "丹恒•饮月",
"FuXuan": "符玄", "FuXuan": "符玄",
"Gepard": "杰帕德", "Gepard": "杰帕德",
"Guinaifen": "桂乃芬",
"Herta": "黑塔", "Herta": "黑塔",
"Himeko": "姬子", "Himeko": "姬子",
"Hook": "虎克", "Hook": "虎克",
@ -385,6 +386,7 @@
"SilverWolf": "银狼", "SilverWolf": "银狼",
"Sushang": "素裳", "Sushang": "素裳",
"Tingyun": "停云", "Tingyun": "停云",
"TopazandNumby": "托帕&账账",
"TrailblazerDestruction": "开拓者•毁灭", "TrailblazerDestruction": "开拓者•毁灭",
"TrailblazerPreservation": "开拓者•存护", "TrailblazerPreservation": "开拓者•存护",
"Welt": "瓦尔特", "Welt": "瓦尔特",

View File

@ -366,6 +366,7 @@
"DanHengImbibitorLunae": "丹恆•飲月", "DanHengImbibitorLunae": "丹恆•飲月",
"FuXuan": "符玄", "FuXuan": "符玄",
"Gepard": "傑帕德", "Gepard": "傑帕德",
"Guinaifen": "桂乃芬",
"Herta": "黑塔", "Herta": "黑塔",
"Himeko": "姬子", "Himeko": "姬子",
"Hook": "虎克", "Hook": "虎克",
@ -385,6 +386,7 @@
"SilverWolf": "銀狼", "SilverWolf": "銀狼",
"Sushang": "素裳", "Sushang": "素裳",
"Tingyun": "停雲", "Tingyun": "停雲",
"TopazandNumby": "托帕&帳帳",
"TrailblazerDestruction": "開拓者•毀滅", "TrailblazerDestruction": "開拓者•毀滅",
"TrailblazerPreservation": "開拓者•存護", "TrailblazerPreservation": "開拓者•存護",
"Welt": "瓦爾特", "Welt": "瓦爾特",

View File

@ -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.main_page import MainPage
from tasks.base.page import Page, page_main from tasks.base.page import Page, page_main
from tasks.combat.assets.assets_combat_finish import COMBAT_EXIT 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.combat.assets.assets_combat_prepare import COMBAT_PREPARE
from tasks.daily.assets.assets_daily_trial import INFO_CLOSE from tasks.daily.assets.assets_daily_trial import INFO_CLOSE
from tasks.login.assets.assets_login import LOGIN_CONFIRM from tasks.login.assets.assets_login import LOGIN_CONFIRM
@ -79,6 +80,19 @@ class UI(MainPage):
if self.ui_additional(): if self.ui_additional():
timeout.reset() timeout.reset()
continue 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() app_check()
minicap_check() minicap_check()
@ -138,13 +152,13 @@ class UI(MainPage):
continue continue
# Additional # Additional
if self.ui_additional():
continue
if self.handle_popup_single(): if self.handle_popup_single():
continue continue
if self.handle_popup_confirm(): if self.handle_popup_confirm():
continue continue
if self.ui_additional(): if self.appear_then_click(LOGIN_CONFIRM, interval=5):
continue
if self.appear_then_click(LOGIN_CONFIRM):
continue continue
# Reset connection # Reset connection

View File

@ -13,3 +13,13 @@ DUNGEON_COMBAT_INTERACT = ButtonWrapper(
button=(750, 411, 997, 448), 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),
),
)

View File

@ -1,5 +1,7 @@
from module.base.utils import color_similar, get_color
from tasks.base.ui import UI 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): class CombatInteract(UI):
@ -12,3 +14,15 @@ class CombatInteract(UI):
return True return True
return False 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