Skip to content

fix(GeneralRoom): 加长组队副本列表滑动距离,修复石距识别失败 - #1899

Open
m123711 wants to merge 1 commit into
runhey:devfrom
m123711:fix/team-list-swipe-distance
Open

m123711 wants to merge 1 commit into
runhey:devfrom
m123711:fix/team-list-swipe-distance

Conversation

@m123711

@m123711 m123711 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

问题

Tako 在组队副本列表里查找「愤怒的石距」时失败,最终因滑动被计入连点保护而报错(参考用户侧日志 log/error/1791606393495):

12:26:22.509  After list: ['觉醒业火轮', '觉醒风转符', '觉醒天雷鼓', '御魂', '日轮之陨', '永生之海']
12:26:24.234  Swipe ( 238,  357) -> ( 221,  297), 0.3175      ← 每次只移动 60px
12:26:26.339  After list: ['觉醒天雷鼓', '御魂', '日轮之陨', '永生之海', '妖气封印', '经验妖怪']
...
12:26:33.493  WARNING Too many click for a button: SWIPE
12:26:33.494  ERROR   GameTooManyClickError: Too many click for a button: SWIPE

原因:check_zones 通过 list_find 查找列表,而 list_find 对纯文字列表固定每次只滑动 1 个列表项(tasks/base_task.py 里 swipe_distance_ratio = 1)。

  • L_TEAM_LIST 的列表项高度是 size=(216, 61),所以每次只滑 61px(日志中 Swipe (238,357) -> (221,297) 正好 60px);
  • 而「石距 / 愤怒的石距」是列表的最后两项(数组索引 13、14),滑到列表末尾时目标只露出一半,OCR 读不到;
  • max_swipe=10 次滑动总行程只有 600px,用完后仍未找到,返回 False。

修改

  • tasks/base_task.py:list_find 新增 swipe_number 参数(默认 1,不改变其它任务的行为),OCR 列表用它作为每次滑动经过的列表项数量;
  • tasks/Component/GeneralRoom/general_room.py:check_zones 调用时传入 swipe_number=3。

3 × 61px = 183px,正好是 3 个列表项的高度,能让列表底部的「愤怒的石距」完整显示出来;10 次滑动的总行程从 600px 提升到 1820px。

验证

用真实的 L_TEAM_LIST 计算 RuleList.swipe_pos() 输出:

swipe_number 滑动坐标(x 有 ±54 随机) 实际距离
1(修改前) (193, 357) → (193, 297) 60px
3(修改后) (193, 418) → (193, 236) 182px

(183px 是标称距离,swipe_pos 中 distance // 2 取整后实际为 182px。)

备注

只加长滑动距离,不改列表内容、判定逻辑与阈值;swipe_number 默认值为 1,因此其它使用 list_find 的任务行为保持不变。

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

嘿——我已经审阅了你的更改,看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的审阅,请考虑分享它们 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@github-actions

Copy link
Copy Markdown
Contributor

Findings

  • C7 [风险]
    位置:tasks/base_task.py 的 list_find
    原因:基础层新增 swipe_number 主要服务 GeneralRoom.check_zones 这一单一场景,扩大了全局 API 和兼容面。
    修改:优先在 GeneralRoom 侧封装该场景的滚动策略;若保留基础层参数,请补充通用使用场景和回归测试,明确其兼容性边界。

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by PR Review Checklist for #1899 · codex · gpt56 · 12.7 AIC · ⌖ 2.63 AIC · ⊞ 12.8K · ◷

@runhey

runhey commented Oct 11, 2026

Copy link
Copy Markdown
Owner

给一下你完整的日志,和控制模拟器方式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants