-
Notifications
You must be signed in to change notification settings - Fork 165
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
base: master
Are you sure you want to change the base?
Conversation
This bug can be reproduced as long as the beginner's Gacha remains. 只要新手卡池还在,几乎每次运行都可复现此BUG。 |
tasks/daily/trail.py
Outdated
# Slide down to find Himeko gacha | ||
if first_gacha: | ||
self.device.swipe((70, 520), (70, 180)) | ||
self.wait_until_stable(REGULAR_GACHA_CHECK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考 Alas 的 代码规范
- 需要判断新手卡池的存在,无新手卡池不应该有下滑操作
- 操作需要有重试
- 避免手写坐标
- 避免依赖 wait_until_stable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收到。将参考规范添加修正相关逻辑。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试: 在有新、无新手卡池的两个号上通过。
小问题: 有额外的拖拽动作,不影响功能。
原因: 模板匹配误判。画面里已经有REGULAR_GACHA却识别不到。
计划解决方案: 限制拖拽次数,或制作新手卡池Button进行匹配。
疑问: 额外的模板匹配或拖拽,不知何者开销更经济?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
优先减少对游戏的操作和截图,识别开销基本忽略不计
tasks/daily/trail.py
Outdated
elif not self.match_color(CHARACTER_TRIAL, interval=2)\ | ||
and dragged_time < 5: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一般不使用无匹配作为条件,条件判断应该是出现新手卡池才进行操作
感谢 @LmeSzinc 的建议指导。制作了_BEGINNER_GACHA_CHECK_用于模板匹配新手卡池,_match_template_color_的识别间隔置4,尽量减少_swipe_vector_对游戏操作。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 图片做得精致一点,不要下面漏出杂色背景,一般就裁切到文字上
- 文字类 assets 不能放在 share 目录下,要适配多语言
- 添加 SEARCH 属性 assets,增大搜索区域以适配没有活动卡池的情况
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
格式化代码 遵循PEP8
修复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.