自动粉爪 路线B优化,提升更新后的线路稳定性#136
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPR 在 HeistPathB 中:把 LG1 流程延伸到 WP5,重构 goto_lg1_skip 的开门/交互控制并调整多处按键按住/释放与等待时序;新增 lg1_wp5_buster;对 lg2_wp2_to_exit2_safer 进行了大幅替换;删除 clear_current_combat_spec。 更改内容LG1 LG2 自动化流程与时序优化
估计代码审查工作量🎯 4 (Complex) | ⏱️ ~45 分钟 可能相关的 PR
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/heist_path/HeistPathB.py`:
- Around line 160-167: The loop waiting for “开门” has no exit and can hang
forever; update the logic in HeistPathB (the isOpenDoor loop that calls wait_ocr
and send_key) to use a bounded retry count or overall timeout (e.g. max_retries
or deadline based), increment a counter or check elapsed time each iteration,
and when exhausted either raise a clear exception (e.g. TimeoutError) or call
the route-abort/cleanup routine (e.g. self.abort_route() or
self.stop_current_route()) so the route terminates instead of looping
indefinitely. Ensure wait_ocr, send_key, and sleep usage remain the same inside
the retry loop and reset isOpenDoor only while retrying.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d3a4a012-8a76-4c81-a998-5049d8658995
📒 Files selected for processing (1)
src/heist_path/HeistPathB.py
1、游戏更新后,大厅到LG1电梯撬开锁也要再点下开门了,这里修复了这个变动导致的大厅到LG1线路稳定性问题; 2、同步优化了线路A在藏品层的稳定性变动。
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/heist_path/HeistPathB.py (1)
390-436: 💤 Low value多次冗余的
switch_to_runner()调用可能影响效率。在约 50 行代码内调用了 8 次
switch_to_runner(),且中间没有可能导致角色切换的操作。每次调用都会发送按键,可能造成不必要的延迟。如果是为了确保角色状态的稳健性,建议至少在关键位置保留
check_switched=True参数;否则可以精简到 2-3 次关键调用。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/heist_path/HeistPathB.py` around lines 390 - 436, This sequence contains many redundant switch_to_runner() calls (around eight) between repeated send_key_down/send_key_up and sleep calls which creates unnecessary overhead; consolidate them by removing intermediate switch_to_runner() calls and keep 2–3 critical switches around logical action boundaries (e.g., before the initial pick start, mid-way between major movement groups, and after the pick end), or when robustness is required call switch_to_runner(check_switched=True) at those critical points; update the block that uses switch_to_runner(), send_key_down/send_key_up, and sleep so that consecutive input sequences that don't require role-switching run under a single switch_to_runner() call.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/heist_path/HeistPathB.py`:
- Around line 160-172: The loop condition is wrong: replace the `or` check with
`and` and use snake_case booleans to stop immediately when OCR finds "开门" —
e.g., rename isOpenDoor→is_open_door and isOpenLoop→open_attempts, initialize
is_open_door = False and open_attempts = 0, then loop while (not is_open_door
and open_attempts < 3); inside, call self.wait_ocr(...), set is_open_door = True
when it matches (use "if self.wait_ocr(...): is_open_door = True else:
self.send_key('f', down_time=0.10); self.sleep(0.32); open_attempts += 1) and
keep subsequent calls to self.send_key_down("w") and self.wait_and_interact(...)
unchanged.
---
Nitpick comments:
In `@src/heist_path/HeistPathB.py`:
- Around line 390-436: This sequence contains many redundant switch_to_runner()
calls (around eight) between repeated send_key_down/send_key_up and sleep calls
which creates unnecessary overhead; consolidate them by removing intermediate
switch_to_runner() calls and keep 2–3 critical switches around logical action
boundaries (e.g., before the initial pick start, mid-way between major movement
groups, and after the pick end), or when robustness is required call
switch_to_runner(check_switched=True) at those critical points; update the block
that uses switch_to_runner(), send_key_down/send_key_up, and sleep so that
consecutive input sequences that don't require role-switching run under a single
switch_to_runner() call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2a98f837-9e6b-46e0-b82c-7158772217f6
📒 Files selected for processing (1)
src/heist_path/HeistPathB.py
|


1、游戏更新后,大厅到LG1电梯撬开锁也要再点下开门了,这里修复了这个变动导致的大厅到LG1线路稳定性问题;
2、同步优化了线路A在藏品层的稳定性变动。
Summary by CodeRabbit
新增功能
优化改进
功能移除