Repository navigation
处理爬塔和御魂本的御魂溢出 - #1937
处理爬塔和御魂本的御魂溢出#1937
Conversation
There was a problem hiding this comment.
嘿——我发现了 4 个问题
给 AI 代理的提示
请处理本次代码审查中的评论:
## 各项评论
### 评论 1
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="161" />
<code_context>
'C_END_BUFF_AREA_2', 'C_END_SOUL_RECORD', 'C_END_SOUL_DETAILS',
'C_END_1_1', 'C_END_1_2', 'C_END_1_3', 'C_END_1_4',
- 'C_END_1_5', 'C_END_1_6',
+ 'C_END_1_5', 'C_END_1_6', "C_OVERFLOW_GHOST",
])
</code_context>
<issue_to_address>
**随机点击导致离开战斗**
胜利后第一次随机点击时,如果溢出清理按钮处于可见状态,`_bw_success_default` 会根据 `excludes_1` 构造 `click_stage_1`,但其中缺少 `C_OVERFLOW_GHOST`,因此在处理溢出之前,随机点击可能会选中“前往清理”,从而离开奖励结算界面。
将 `C_OVERFLOW_GHOST` 添加到 `excludes_1`,这样胜利后的第一次随机点击就会避开清理按钮。
</issue_to_address>
### 评论 2
<location path="tasks/Orochi/script_task.py" line_range="437-438" />
<code_context>
while 1:
self.screenshot()
+ # 处理御魂溢出
+ if self.appear_then_click(self.I_OVER_GHOST):
+ continue
+
action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
</code_context>
<issue_to_address>
**大蛇任务卡住**
如果溢出提示在检测到任一奖励指示器之前出现,或遮挡了两个奖励指示器,`battle_wait` 只会在奖励循环中检查 `I_OVER_GHOST`。而外层循环只有在检测到 `I_GREED_GHOST` 或 `I_REWARD` 后才会进入奖励循环,因此它永远不会关闭该提示,大蛇任务也就会一直卡住。
在外层循环中、根据奖励指示器进行分支判断之前,检查并关闭 `I_OVER_GHOST`。
`tasks/Orochi/script_task.py:452-454` 处也有同样的问题。
</issue_to_address>
### 评论 3
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
# 比如 御魂溢出
+
+ # 结算的时候御魂溢出提示,点击【知道了】
+ self.appear_then_click(self.I_OVER_GHOST)
+
return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**旧版战斗流程未处理溢出**
使用旧版 `GeneralBattle.battle_wait` 路径的任务遇到溢出提示时,`GeneralBattle.battle_wait` 会覆盖由钩子驱动的等待循环,而 `run_general_battle` 会调用这个覆盖实现,因此这些调用方永远不会执行 `_bw_interrupt_default`。如果这类战斗中出现溢出提示,新增的处理逻辑不会关闭它,调用方就会卡在被阻塞的奖励流程中。
也应在旧版战斗等待的奖励流程中加入溢出提示关闭逻辑,或者让这些调用方改用由钩子驱动的实现。
</issue_to_address>
### 评论 4
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
# 比如 御魂溢出
+
+ # 结算的时候御魂溢出提示,点击【知道了】
+ self.appear_then_click(self.I_OVER_GHOST)
+
return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**武斗会爬塔时未关闭溢出提示**
武斗大会爬塔在战斗结算期间遇到溢出提示时,`Foot.battle_wait_daily_training` 和 `Foot.battle_wait_cultivation_drills` 会覆盖共享的战斗等待流程,因此它们不会调用此中断处理程序;它们的结果循环也不会关闭 `I_OVER_GHOST`,导致武斗大会爬塔卡在溢出提示界面。
在武斗大会的战斗等待覆盖实现中加入溢出提示检测和关闭逻辑,或者让该任务改用共享的中断流程。
</issue_to_address>Sourcery 评估
等待批准。 请先处理这 4 项发现。
阻塞性发现:tasks/Component/GeneralBattle/battle_wait.py:161、tasks/Orochi/script_task.py:438、tasks/Component/GeneralBattle/battle_wait.py:1157、tasks/Component/GeneralBattle/battle_wait.py:1157
Original comment in English
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="161" />
<code_context>
'C_END_BUFF_AREA_2', 'C_END_SOUL_RECORD', 'C_END_SOUL_DETAILS',
'C_END_1_1', 'C_END_1_2', 'C_END_1_3', 'C_END_1_4',
- 'C_END_1_5', 'C_END_1_6',
+ 'C_END_1_5', 'C_END_1_6', "C_OVERFLOW_GHOST",
])
</code_context>
<issue_to_address>
**Random click leaves battle**
When the overflow cleanup button is visible during the first post-win random click, `_bw_success_default` builds `click_stage_1` from `excludes_1`, which lacks `C_OVERFLOW_GHOST`, so the random click can select “Go Clean” before overflow handling runs and navigate away from reward settlement.
Add `C_OVERFLOW_GHOST` to `excludes_1` so the first post-win random click avoids the cleanup button.
</issue_to_address>
### Comment 2
<location path="tasks/Orochi/script_task.py" line_range="437-438" />
<code_context>
while 1:
self.screenshot()
+ # 处理御魂溢出
+ if self.appear_then_click(self.I_OVER_GHOST):
+ continue
+
action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
</code_context>
<issue_to_address>
**Orochi task remains stuck**
When the overflow prompt appears before either reward indicator is detected, or obscures both indicators, `battle_wait` only checks `I_OVER_GHOST` inside reward loops, which the outer loop enters after detecting `I_GREED_GHOST` or `I_REWARD`; it therefore never dismisses the prompt and the Orochi task remains stuck.
Check and dismiss `I_OVER_GHOST` in the outer loop before branching on the reward indicators.
Also at `tasks/Orochi/script_task.py:452-454`.
</issue_to_address>
### Comment 3
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
# 比如 御魂溢出
+
+ # 结算的时候御魂溢出提示,点击【知道了】
+ self.appear_then_click(self.I_OVER_GHOST)
+
return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**Legacy battle flow skips overflow handling**
When a task using the legacy `GeneralBattle.battle_wait` path encounters an overflow prompt, `GeneralBattle.battle_wait` overrides the hook-driven wait loop, and `run_general_battle` calls that override, so those callers never execute `_bw_interrupt_default`. When an overflow prompt appears during one of these battles, the added handler does not dismiss it and the caller remains on the blocked reward flow.
Add overflow dismissal to the legacy battle-wait reward flow as well, or route those callers through the hook-driven implementation.
</issue_to_address>
### Comment 4
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
# 比如 御魂溢出
+
+ # 结算的时候御魂溢出提示,点击【知道了】
+ self.appear_then_click(self.I_OVER_GHOST)
+
return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**Budokai tower leaves overflow prompt**
When a Budokai Tournament climb encounters the overflow prompt during battle settlement, `Foot.battle_wait_daily_training` and `Foot.battle_wait_cultivation_drills` override the shared battle-wait flow, so they never call this interrupt handler; their result loops do not dismiss `I_OVER_GHOST`, leaving the Budokai climb stuck on the overflow prompt.
Add overflow detection and dismissal to the Budokai Tournament battle-wait override, or route that task through the shared interrupt flow.
</issue_to_address>Sourcery assessment
Approval pending. 4 findings to address first.
Blocking findings: tasks/Component/GeneralBattle/battle_wait.py:161, tasks/Orochi/script_task.py:438, tasks/Component/GeneralBattle/battle_wait.py:1157, tasks/Component/GeneralBattle/battle_wait.py:1157
| 'C_END_BUFF_AREA_2', 'C_END_SOUL_RECORD', 'C_END_SOUL_DETAILS', | ||
| 'C_END_1_1', 'C_END_1_2', 'C_END_1_3', 'C_END_1_4', | ||
| 'C_END_1_5', 'C_END_1_6', | ||
| 'C_END_1_5', 'C_END_1_6', "C_OVERFLOW_GHOST", |
There was a problem hiding this comment.
🟡 Medium · 随机点击导致离开战斗
胜利后第一次随机点击时,如果溢出清理按钮处于可见状态,_bw_success_default 会根据 excludes_1 构造 click_stage_1,但其中缺少 C_OVERFLOW_GHOST,因此在处理溢出之前,随机点击可能会选中“前往清理”,从而离开奖励结算界面。
将 C_OVERFLOW_GHOST 添加到 excludes_1,这样胜利后的第一次随机点击就会避开清理按钮。
给 AI 代理的提示
在 `tasks/Component/GeneralBattle/battle_wait.py` 第 161 行:
**随机点击导致离开战斗**
胜利后第一次随机点击时,如果溢出清理按钮处于可见状态,`_bw_success_default` 会根据 `excludes_1` 构造 `click_stage_1`,但其中缺少 `C_OVERFLOW_GHOST`,因此在处理溢出之前,随机点击可能会选中“前往清理”,从而离开奖励结算界面。
将 `C_OVERFLOW_GHOST` 添加到 `excludes_1`,这样胜利后的第一次随机点击就会避开清理按钮。Original comment in English
🟡 Medium · Random click leaves battle
When the overflow cleanup button is visible during the first post-win random click, _bw_success_default builds click_stage_1 from excludes_1, which lacks C_OVERFLOW_GHOST, so the random click can select “Go Clean” before overflow handling runs and navigate away from reward settlement.
Add C_OVERFLOW_GHOST to excludes_1 so the first post-win random click avoids the cleanup button.
Prompt for AI agents
In `tasks/Component/GeneralBattle/battle_wait.py` at line 161:
**Random click leaves battle**
When the overflow cleanup button is visible during the first post-win random click, `_bw_success_default` builds `click_stage_1` from `excludes_1`, which lacks `C_OVERFLOW_GHOST`, so the random click can select “Go Clean” before overflow handling runs and navigate away from reward settlement.
Add `C_OVERFLOW_GHOST` to `excludes_1` so the first post-win random click avoids the cleanup button.| if self.appear_then_click(self.I_OVER_GHOST): | ||
| continue |
There was a problem hiding this comment.
🟠 High · 大蛇任务卡住
如果溢出提示在检测到任一奖励指示器之前出现,或遮挡了两个奖励指示器,battle_wait 只会在奖励循环中检查 I_OVER_GHOST。而外层循环只有在检测到 I_GREED_GHOST 或 I_REWARD 后才会进入奖励循环,因此它永远不会关闭该提示,大蛇任务也就会一直卡住。
在外层循环中、根据奖励指示器进行分支判断之前,检查并关闭 I_OVER_GHOST。
tasks/Orochi/script_task.py:452-454 处也有同样的问题。
给 AI 代理的提示
在 `tasks/Orochi/script_task.py` 第 437-438 行:
**大蛇任务卡住**
如果溢出提示在检测到任一奖励指示器之前出现,或遮挡了两个奖励指示器,`battle_wait` 只会在奖励循环中检查 `I_OVER_GHOST`。而外层循环只有在检测到 `I_GREED_GHOST` 或 `I_REWARD` 后才会进入奖励循环,因此它永远不会关闭该提示,大蛇任务也就会一直卡住。
在外层循环中、根据奖励指示器进行分支判断之前,检查并关闭 `I_OVER_GHOST`。
`tasks/Orochi/script_task.py:452-454` 处也有同样的问题。Original comment in English
🟠 High · Orochi task remains stuck
When the overflow prompt appears before either reward indicator is detected, or obscures both indicators, battle_wait only checks I_OVER_GHOST inside reward loops, which the outer loop enters after detecting I_GREED_GHOST or I_REWARD; it therefore never dismisses the prompt and the Orochi task remains stuck.
Check and dismiss I_OVER_GHOST in the outer loop before branching on the reward indicators.
Also at tasks/Orochi/script_task.py:452-454.
Prompt for AI agents
In `tasks/Orochi/script_task.py` at lines 437-438:
**Orochi task remains stuck**
When the overflow prompt appears before either reward indicator is detected, or obscures both indicators, `battle_wait` only checks `I_OVER_GHOST` inside reward loops, which the outer loop enters after detecting `I_GREED_GHOST` or `I_REWARD`; it therefore never dismisses the prompt and the Orochi task remains stuck.
Check and dismiss `I_OVER_GHOST` in the outer loop before branching on the reward indicators.
Also at `tasks/Orochi/script_task.py:452-454`.| # 比如 御魂溢出 | ||
|
|
||
| # 结算的时候御魂溢出提示,点击【知道了】 | ||
| self.appear_then_click(self.I_OVER_GHOST) |
There was a problem hiding this comment.
🟡 Medium · 旧版战斗流程未处理溢出
使用旧版 GeneralBattle.battle_wait 路径的任务遇到溢出提示时,GeneralBattle.battle_wait 会覆盖由钩子驱动的等待循环,而 run_general_battle 会调用这个覆盖实现,因此这些调用方永远不会执行 _bw_interrupt_default。如果这类战斗中出现溢出提示,新增的处理逻辑不会关闭它,调用方就会卡在被阻塞的奖励流程中。
也应在旧版战斗等待的奖励流程中加入溢出提示关闭逻辑,或者让这些调用方改用由钩子驱动的实现。
给 AI 代理的提示
在 `tasks/Component/GeneralBattle/battle_wait.py` 第 1157 行:
**旧版战斗流程未处理溢出**
使用旧版 `GeneralBattle.battle_wait` 路径的任务遇到溢出提示时,`GeneralBattle.battle_wait` 会覆盖由钩子驱动的等待循环,而 `run_general_battle` 会调用这个覆盖实现,因此这些调用方永远不会执行 `_bw_interrupt_default`。如果这类战斗中出现溢出提示,新增的处理逻辑不会关闭它,调用方就会卡在被阻塞的奖励流程中。
也应在旧版战斗等待的奖励流程中加入溢出提示关闭逻辑,或者让这些调用方改用由钩子驱动的实现。Original comment in English
🟡 Medium · Legacy battle flow skips overflow handling
When a task using the legacy GeneralBattle.battle_wait path encounters an overflow prompt, GeneralBattle.battle_wait overrides the hook-driven wait loop, and run_general_battle calls that override, so those callers never execute _bw_interrupt_default. When an overflow prompt appears during one of these battles, the added handler does not dismiss it and the caller remains on the blocked reward flow.
Add overflow dismissal to the legacy battle-wait reward flow as well, or route those callers through the hook-driven implementation.
Prompt for AI agents
In `tasks/Component/GeneralBattle/battle_wait.py` at line 1157:
**Legacy battle flow skips overflow handling**
When a task using the legacy `GeneralBattle.battle_wait` path encounters an overflow prompt, `GeneralBattle.battle_wait` overrides the hook-driven wait loop, and `run_general_battle` calls that override, so those callers never execute `_bw_interrupt_default`. When an overflow prompt appears during one of these battles, the added handler does not dismiss it and the caller remains on the blocked reward flow.
Add overflow dismissal to the legacy battle-wait reward flow as well, or route those callers through the hook-driven implementation.| # 比如 御魂溢出 | ||
|
|
||
| # 结算的时候御魂溢出提示,点击【知道了】 | ||
| self.appear_then_click(self.I_OVER_GHOST) |
There was a problem hiding this comment.
🟠 High · 武斗会爬塔时未关闭溢出提示
武斗大会爬塔在战斗结算期间遇到溢出提示时,Foot.battle_wait_daily_training 和 Foot.battle_wait_cultivation_drills 会覆盖共享的战斗等待流程,因此它们不会调用此中断处理程序;它们的结果循环也不会关闭 I_OVER_GHOST,导致武斗大会爬塔卡在溢出提示界面。
在武斗大会的战斗等待覆盖实现中加入溢出提示检测和关闭逻辑,或者让该任务改用共享的中断流程。
给 AI 代理的提示
在 `tasks/Component/GeneralBattle/battle_wait.py` 第 1157 行:
**武斗会爬塔时未关闭溢出提示**
武斗大会爬塔在战斗结算期间遇到溢出提示时,`Foot.battle_wait_daily_training` 和 `Foot.battle_wait_cultivation_drills` 会覆盖共享的战斗等待流程,因此它们不会调用此中断处理程序;它们的结果循环也不会关闭 `I_OVER_GHOST`,导致武斗大会爬塔卡在溢出提示界面。
在武斗大会的战斗等待覆盖实现中加入溢出提示检测和关闭逻辑,或者让该任务改用共享的中断流程。Original comment in English
🟠 High · Budokai tower leaves overflow prompt
When a Budokai Tournament climb encounters the overflow prompt during battle settlement, Foot.battle_wait_daily_training and Foot.battle_wait_cultivation_drills override the shared battle-wait flow, so they never call this interrupt handler; their result loops do not dismiss I_OVER_GHOST, leaving the Budokai climb stuck on the overflow prompt.
Add overflow detection and dismissal to the Budokai Tournament battle-wait override, or route that task through the shared interrupt flow.
Prompt for AI agents
In `tasks/Component/GeneralBattle/battle_wait.py` at line 1157:
**Budokai tower leaves overflow prompt**
When a Budokai Tournament climb encounters the overflow prompt during battle settlement, `Foot.battle_wait_daily_training` and `Foot.battle_wait_cultivation_drills` override the shared battle-wait flow, so they never call this interrupt handler; their result loops do not dismiss `I_OVER_GHOST`, leaving the Budokai climb stuck on the overflow prompt.
Add overflow detection and dismissal to the Budokai Tournament battle-wait override, or route that task through the shared interrupt flow.
Findings
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "ab.chatgpt.com"See Network Configuration for more information.
|
|
good |
1 处理爬塔的御魂溢出,
在interupt循环内部处理,success里面判断遇到御魂溢出,直接退出循环,重新再interupt循环里面处理御魂溢出。排除区域里面增加【去清理】按钮区域,不排除可能直接进入清理,打断循环。
2 处理御魂本的御魂溢出提示
直接修改御魂任务,里面重写的部分。
Sourcery 摘要
处理塔楼和 Orochi 战斗中的灵魂溢出提示,避免奖励处理循环卡住。
错误修复:
功能增强:
Original summary in English
Summary by Sourcery
Handle soul overflow prompts across tower and Orochi battles to prevent reward-processing loops from getting stuck.
Bug Fixes:
Enhancements: