Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bug:Stuck at Gacha in Himeko Trail #401

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

zhaoqiman
Copy link

修复bug: 姬子试用卡在抽卡界面
新手卡池未抽完时,常驻卡池在最下方页面外,无法正常识别,导致在姬子试用环节卡死。
通过添加了左侧的卡池滑动动作,显示出卡池,以防止此bug。

Fix:Stuck at Gacha when Himeko Trail
In Himeko Trial, if beginner's gacha remains, target gacha will be outside of the page, thus program stuch at gacha page.
Add slide action on left of the page to fix it.

@zhaoqiman
Copy link
Author

Related Issues:
#176
#374
#337
#275

@zhaoqiman zhaoqiman changed the title Fix:Stuck at Gacha when Himeko Trail Fix Bug:Stuck at Gacha when Himeko Trail Apr 2, 2024
@zhaoqiman zhaoqiman changed the title Fix Bug:Stuck at Gacha when Himeko Trail Fix Bug:Stuck at Gacha in Himeko Trail Apr 2, 2024
@zhaoqiman
Copy link
Author

This bug can be reproduced as long as the beginner's Gacha remains.
Bug is fixed by adding drag action, tested over the past few days.

只要新手卡池还在,几乎每次运行都可复现此BUG。
这几天测试,经添加拖拽动作可解决。

Comment on lines 77 to 80
# Slide down to find Himeko gacha
if first_gacha:
self.device.swipe((70, 520), (70, 180))
self.wait_until_stable(REGULAR_GACHA_CHECK)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考 Alas 的 代码规范

  1. 需要判断新手卡池的存在,无新手卡池不应该有下滑操作
  2. 操作需要有重试
  3. 避免手写坐标
  4. 避免依赖 wait_until_stable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收到。将参考规范添加修正相关逻辑。

@LmeSzinc LmeSzinc added bug / 缺陷 Something isn't working good first issue / 首次贡献 Good for newcomers labels Apr 5, 2024
@zhaoqiman zhaoqiman marked this pull request as draft April 5, 2024 12:29
zhaoqiman

This comment was marked as outdated.

@zhaoqiman zhaoqiman marked this pull request as ready for review April 6, 2024 05:13
Copy link
Author

@zhaoqiman zhaoqiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试: 在有新、无新手卡池的两个号上通过。
小问题: 有额外的拖拽动作,不影响功能。
原因: 模板匹配误判。画面里已经有REGULAR_GACHA却识别不到。

计划解决方案: 限制拖拽次数,或制作新手卡池Button进行匹配。
疑问: 额外的模板匹配或拖拽,不知何者开销更经济?

Copy link
Owner

@LmeSzinc LmeSzinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

优先减少对游戏的操作和截图,识别开销基本忽略不计

Comment on lines 79 to 80
elif not self.match_color(CHARACTER_TRIAL, interval=2)\
and dragged_time < 5:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般不使用无匹配作为条件,条件判断应该是出现新手卡池才进行操作

@zhaoqiman zhaoqiman requested a review from LmeSzinc April 12, 2024 05:08
@zhaoqiman
Copy link
Author

感谢 @LmeSzinc 的建议指导。制作了_BEGINNER_GACHA_CHECK_用于模板匹配新手卡池,_match_template_color_的识别间隔置4,尽量减少_swipe_vector_对游戏操作。
无新手卡池账号测试:未发现拖拽动作,不影响原功能原性能。
有新手卡池账号测试:经一次拖拽动作,能实现下滑找到常规卡池。未发现多余拖拽动作。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 图片做得精致一点,不要下面漏出杂色背景,一般就裁切到文字上
  2. 文字类 assets 不能放在 share 目录下,要适配多语言
  3. 添加 SEARCH 属性 assets,增大搜索区域以适配没有活动卡池的情况

Comment on lines +78 to +83
# Slide down to find regular gacha if beginner gacha found
if self.match_template_color(BEGINNER_GACHA_CHECK,interval=4):
swipe_vector = (0, -4*REGULAR_GACHA_CLICK.height)
self.device.swipe_vector(swipe_vector, box=REGULAR_GACHA_CLICK.search,
random_range=(-10, -10, 10, 10), name='FIND_REGULAR_GACHA_DRAG')
continue
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

格式化代码 遵循PEP8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / 缺陷 Something isn't working good first issue / 首次贡献 Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants