Skip to content

fix(Exploration): scroll chapter list the right way in open_expect_level - #1904

Closed
Enough1122 wants to merge 2 commits into
runhey:devfrom
Enough1122:fix/exploration-level-swipe
Closed

Enough1122 wants to merge 2 commits into
runhey:devfrom
Enough1122:fix/exploration-level-swipe

Conversation

@Enough1122

@Enough1122 Enough1122 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

症状

Exploration 配了第二十八章,每次死在选关:GameStuckError: Swiped too many times (15)。连续 3 轮共 45 次滑动,OCR 每次读到的都是第一/二/三章——列表零位移。截图(章节列表停在顶部,第一章到第四章):

stuck at top

根因

open_expect_level 里用的是 S_SWIPE_LEVEL_UP,即手指从上往下(y 328→444),把列表内容往下拉——而列表打开时恒定停在顶部,每次滑动都是顶着上边界空转。要去下面的章节必须用一直闲置的 S_SWIPE_LEVEL_DOWN(手指自下而上,y 486→367)。仓库里这个规则存在但没有任何调用,属接错线。

修复(2 行,同一个函数)

  1. 换滑动方向:S_SWIPE_LEVEL_UP → S_SWIPE_LEVEL_DOWN
  2. 上限 15 → 25:从顶部到第二十八章实测需要约 17 次滑动(每次约 2 章,偶有 OCR 抖动少走一章),15 次会在二十四章处被误杀;25 是 1943709 之前用过的值

验证

  • 真机(MuMu 1280x720):重启后列表从十一章一路翻到二十四章,点第二十八章进图,连赢数场收奖励,任务正常 farming
  • 日志签名:Swiped N times, current exploration level: [...] 逐次推进,而非原地踏步

Unverified / please confirm:

  • 手头只有 1280x720 的样本,其他分辨率下滑动坐标是否仍落在章节列表上,请确认

Sourcery 摘要

通过向正确方向滚动并允许后续章节进行额外的滚动尝试,修复探索等级选择问题。

错误修复:

  • 修正探索章节导航,使等级选择向后续章节滚动,而不是反复尝试滚过顶部。
  • 增加探索滚动重试次数上限,以支持到达更深层的章节。
Original summary in English

Summary by Sourcery

Fix exploration level selection by scrolling in the correct direction and allowing additional scroll attempts for later chapters.

Bug Fixes:

  • Correct exploration chapter navigation so level selection scrolls toward later chapters instead of repeatedly attempting to scroll past the top.
  • Increase the exploration scroll retry limit to support reaching deeper chapters.

open_expect_level swiped S_SWIPE_LEVEL_UP (finger top-to-bottom,
y 328->444), which drags the list toward its top. The list always opens
at chapters 1-4, so all 45 swipes (3 attempts x 15) were no-ops against
the top bound and the task died with GameStuckError every time while
targeting 第二十八章. Use the previously-unused S_SWIPE_LEVEL_DOWN
(finger bottom-to-top, y 486->367) instead.

Evidence: log/error/1791616956528 (and +88/+220) show the stuck loop
with zero list movement; live run after the fix scrolled 11->24 across
swipes, tapped 第二十八章, and farmed normally (battle win + rewards).
Top-to-28 needs ~17 swipes at ~2 chapters/swipe; the 15 cap (cut from 25
in 1943709) kills the first attempt at ch.22-24 even with the direction
fix. 25 restores the previous known-good value. Kept local, no PR yet.

@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.

嘿——我发现了 1 个问题

给 AI 代理的提示
请处理此次代码审查中的评论:

## 单独评论

### 评论 1
<location path="tasks/Exploration/base.py" line_range="172" />
<code_context>
             debug_info = f"Swiped {swipeCount} times, current exploration level: {text1}"
             logger.info(debug_info)
-            if swipeCount >= 15:
+            if swipeCount >= 25:
                 raise GameStuckError(
                     f"Swiped too many times ({swipeCount}), seems stuck in exploration level selection"
</code_context>
<issue_to_address>
**可见章节被拒绝**

当目标章节恰好在滑动 25 次后首次变得可见时,`open_expect_level` 会在第 25 次滑动后立即抛出 `GameStuckError`,此时还未再次截图或检查目标章节是否可见,因此调用方会失败,而不是进入该章节。

请在滑动后检查截图,然后再执行滑动次数限制。
</issue_to_address>

Sourcery 评估

等待批准。 请先处理 1 个发现的问题。

阻塞性发现:tasks/Exploration/base.py:172


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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tasks/Exploration/base.py" line_range="172" />
<code_context>
             debug_info = f"Swiped {swipeCount} times, current exploration level: {text1}"
             logger.info(debug_info)
-            if swipeCount >= 15:
+            if swipeCount >= 25:
                 raise GameStuckError(
                     f"Swiped too many times ({swipeCount}), seems stuck in exploration level selection"
</code_context>
<issue_to_address>
**Visible chapter is rejected**

When the target chapter first becomes visible after exactly 25 swipes, `open_expect_level` raises `GameStuckError` immediately after the 25th swipe, before taking another screenshot or checking whether the target chapter is visible, so the caller fails instead of entering it.

Check the screenshot after the swipe before enforcing the swipe limit.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: tasks/Exploration/base.py:172


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

Comment thread tasks/Exploration/base.py
debug_info = f"Swiped {swipeCount} times, current exploration level: {text1}"
logger.info(debug_info)
if swipeCount >= 15:
if swipeCount >= 25:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 中等 · 可见章节被拒绝

当目标章节恰好在滑动 25 次后首次变得可见时,open_expect_level 会在第 25 次滑动后立即抛出 GameStuckError,此时还未再次截图或检查目标章节是否可见,因此调用方会失败,而不是进入该章节。

请在滑动后检查截图,然后再执行滑动次数限制。

给 AI 代理的提示
在 `tasks/Exploration/base.py` 第 172 行:

**可见章节被拒绝**

当目标章节恰好在滑动 25 次后首次变得可见时,`open_expect_level` 会在第 25 次滑动后立即抛出 `GameStuckError`,此时还未再次截图或检查目标章节是否可见,因此调用方会失败,而不是进入该章节。

请在滑动后检查截图,然后再执行滑动次数限制。
Original comment in English

🟡 Medium · Visible chapter is rejected

When the target chapter first becomes visible after exactly 25 swipes, open_expect_level raises GameStuckError immediately after the 25th swipe, before taking another screenshot or checking whether the target chapter is visible, so the caller fails instead of entering it.

Check the screenshot after the swipe before enforcing the swipe limit.

Prompt for AI agents
In `tasks/Exploration/base.py` at line 172:

**Visible chapter is rejected**

When the target chapter first becomes visible after exactly 25 swipes, `open_expect_level` raises `GameStuckError` immediately after the 25th swipe, before taking another screenshot or checking whether the target chapter is visible, so the caller fails instead of entering it.

Check the screenshot after the swipe before enforcing the swipe limit.

@github-actions

Copy link
Copy Markdown
Contributor

Findings

  • C2 [风险]
    位置:tasks/Exploration/base.py:172,open_expect_level
    原因:第 25 次滑动后立即抛出异常,若目标章节恰在该次滑动后可见,代码不会再次识别并点击目标。
    修改:滑动后先重新截图并检查目标章节,确认不可见时再执行次数上限判断。
  • C5 [风险]
    位置:tasks/Exploration/base.py,open_expect_level
    原因:本次修改没有补充自动化测试,关键的方向切换和 25 次边界缺少可重复验证。
    修改:增加覆盖滑动方向及达到上限后目标可见场景的测试,至少验证第 25 次滑动后的检查顺序。
  • C7 [不确定]
    位置:tasks/Exploration/base.py,open_expect_level;S_SWIPE_LEVEL_DOWN
    原因:PR 仅验证 1280x720,无法确认固定滑动坐标在其他分辨率或显示缩放下仍落在章节列表区域。
    修改:补充其他支持分辨率的验证,或改用与屏幕尺寸/列表区域动态计算的滑动坐标。

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 #1904 · codex · gpt56 · 9.91 AIC · ⌖ 2.59 AIC · ⊞ 12.8K · ◷

@runhey

runhey commented Oct 11, 2026

Copy link
Copy Markdown
Owner
  1. ai 一堆废话
  2. 往上滑是因为检测不到 困28. 你先确定一下是一开始的时候就没有困28,还是真的检测不到困28
  3. 我发现从庭院进来每次都是在困28这里(不行就再来一次),所以这里压根一开始就停在困28
  4. 能让探索一开始停在别的章节的就两种情况:(1)人手动 (2)打完悬赏里面的探索
  5. 所以合理的机制应该是保留滑动顺序,因为你往下滑就检测不到低级的探索章节

@runhey runhey closed this Oct 11, 2026
@Enough1122

Copy link
Copy Markdown
Contributor Author

你看下是不是每次点了28章,直接选择回退,列表是不是变成了第一章,我怀疑是中途突破卷满了,没有完整刷完一轮选择了退出,刷完突破回来就卡在第一章了
image
image

@runhey runhey reopened this Oct 11, 2026
@abers12345

Copy link
Copy Markdown
  1. ai 一堆废话
  2. 往上滑是因为检测不到困28。 你先确定一下是一开始的时候就没有困28,还是真的检测不到困28
  3. 我发现从庭院进来每次都是在困28这里(不行就再来一次),所以这里压根一开始就停在困28
  4. 允许探索一开​​始停止在其他章节的就两种情况:(1)人手动(2)打完悬赏里面的探索
  5. 所以合理的机制应该保持滑动顺序,因为你往前就检测到低于低级的探索章节

这个问题确实存在,这两天挂困28的都应该碰到过这个问题,原因确实是描述的这样,困28正常刷取退出正常逻辑是会回到挑战困28界面,但是有时候会退出(卡出)这个界面,这个时候外面右侧的章节是在第一章开始,这时候就会触发脚本开始滑动,但是由于设置的逻辑问题滑动不到困28,,然后脚本就会卡死

@runhey

runhey commented Oct 11, 2026

Copy link
Copy Markdown
Owner

#1912 这儿吗

@abers12345

This comment was marked as off-topic.

@abers12345

Copy link
Copy Markdown

第1912章这里吗

#1919 我建立了一个新的问题, 里面是我不久之前重现的报错日志,这个和我描述的问题是一致的

@runhey

runhey commented Oct 11, 2026

Copy link
Copy Markdown
Owner

这样,在滑动之前先做一次ocr, 判断当前是什么的第几个章节,然后和目标章节判断一下看看选什么的方向,这里可以做三个或者两次尝试,避免滑过头。 让AI做的时候别拉一堆代码,要精简

@Enough1122

Copy link
Copy Markdown
Contributor Author

等今晚0点我刷绘卷时候自测下

@runhey runhey closed this Oct 13, 2026
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.

3 participants