Fix-team-explor - #1704
Conversation
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并留下了一些整体性的反馈:
- 在
invite_friend中,条件if not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):是冗余的并且很可能是一个 bug;它很可能本意是检查第二个控件或者使用and,请根据预期的状态判断逻辑调整这里的实现。 - 新增的
_check_mate_leave辅助函数在调用方已经根据I_TEAM_EMOJI/I_TEAM_EMOJI_FIGHT分支处理之后,又重新执行了一遍这些检查,这会让调用点更难理解;建议把appear检查逻辑完全移动到该辅助函数内部,并简化调用方,以避免重复检查和重复逻辑。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `invite_friend`, the condition `if not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):` is redundant and likely a bug; it probably meant to check a second control or use `and`, so please adjust this logic to reflect the intended state check.
- The new `_check_mate_leave` helper re-runs the `I_TEAM_EMOJI`/`I_TEAM_EMOJI_FIGHT` checks even when the callers have already branched on those conditions, which makes the call sites harder to reason about; consider moving the appear checks fully inside the helper and simplifying the call sites to avoid redundant checks and duplicated logic.
## Individual Comments
### Comment 1
<location path="tasks/Exploration/solo.py" line_range="373-374" />
<code_context>
continue
if self.appear_then_click(self.I_ADD_5_4, interval=1):
continue
+ # 避免中途队友进来邀请死循环
+ if not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):
+ # 可能刚好点到人,点一下空地方
+ self.device.click(x=370, y=480, control_name='exploration_invite_friend_prevent')
</code_context>
<issue_to_address>
**issue (bug_risk):** The `invite_friend` guard condition uses the same check twice and may not reflect the intended logic.
`if not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):` is logically the same as a single `if not self.appear(self.I_ADD_2):`, so the second clause is redundant. Given the comment about preventing an invite deadlock when teammates join mid-process, please confirm whether a different condition (e.g., another icon or a different state combined via `and`/`or`) was intended here, and then either simplify or correct the condition accordingly.
</issue_to_address>Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- In
invite_friend, the conditionif not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):is redundant and likely a bug; it probably meant to check a second control or useand, so please adjust this logic to reflect the intended state check. - The new
_check_mate_leavehelper re-runs theI_TEAM_EMOJI/I_TEAM_EMOJI_FIGHTchecks even when the callers have already branched on those conditions, which makes the call sites harder to reason about; consider moving the appear checks fully inside the helper and simplifying the call sites to avoid redundant checks and duplicated logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `invite_friend`, the condition `if not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):` is redundant and likely a bug; it probably meant to check a second control or use `and`, so please adjust this logic to reflect the intended state check.
- The new `_check_mate_leave` helper re-runs the `I_TEAM_EMOJI`/`I_TEAM_EMOJI_FIGHT` checks even when the callers have already branched on those conditions, which makes the call sites harder to reason about; consider moving the appear checks fully inside the helper and simplifying the call sites to avoid redundant checks and duplicated logic.
## Individual Comments
### Comment 1
<location path="tasks/Exploration/solo.py" line_range="373-374" />
<code_context>
continue
if self.appear_then_click(self.I_ADD_5_4, interval=1):
continue
+ # 避免中途队友进来邀请死循环
+ if not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):
+ # 可能刚好点到人,点一下空地方
+ self.device.click(x=370, y=480, control_name='exploration_invite_friend_prevent')
</code_context>
<issue_to_address>
**issue (bug_risk):** The `invite_friend` guard condition uses the same check twice and may not reflect the intended logic.
`if not self.appear(self.I_ADD_2) or not self.appear(self.I_ADD_2):` is logically the same as a single `if not self.appear(self.I_ADD_2):`, so the second clause is redundant. Given the comment about preventing an invite deadlock when teammates join mid-process, please confirm whether a different condition (e.g., another icon or a different state combined via `and`/`or`) was intended here, and then either simplify or correct the condition accordingly.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
一边肝绘卷一边改的,可以比较顺畅的挂满绘卷模式的一轮。组队全打到组队只打达摩。有个优先级比较低的bug,跨区好友邀请会卡在寮友,这里没修 |
|
挺好的 |
|
tasks/Exploration/res/res_exp_leader.png 这个是多余的呀 |
|
我很不喜欢ai写的东西, |
|
10秒改成三秒太激进了,一个网络波动或者低配置机器就没了 |
|
想起来了,当时 D:\Project\OnmyojiAutoScript\tasks\WantedQuests\explore.py 这里修改了滑动的逻辑,但是忘记同步过去了, |
删掉了
这里加了战斗场景中组队状态识别,所以 3s 是留给加载页面的,我 2g2核 的配置双开是 ok 的。个人认为 在指定加成探索场景 为低概率情况去大幅增加频繁退出的成本是得不偿失的,在全打场景偶尔误退出的损失也是可以接受的
当时着急用没深究原来的代码,ai 说可能是缓存导致的问题就直接新起了套,现在参考 WantedQuests\explore.py 改了一版。 这两个提交影响的功能简单测了几轮,下次肝绘卷我再多测测( |
|
另外 RuleAnimate.stable 这个方法第一次存的整张图,后面存截取之后的图,所以会导致需要连续匹配两次才会退出 (6s+),不知道这是否符合预期。这个改了影响面会比较大我就没动 |
|
tasks/Exploration/res/res_swipe_end.png 的区域改成最右侧的一条,减少怪物移动的影响 |
|
可以可以 |
优化双人组队探索逻辑
Summary by Sourcery
改进双人队伍的探索行为,包括更可靠的地图末端检测、队友离开处理以及宝箱交互。
Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
Improve dual-team exploration behavior, including more robust end-of-map detection, teammate leave handling, and treasure chest interaction.
Bug Fixes:
Enhancements: