Repository navigation
道馆开启尝试移到查找循环之前 - #1976
道馆开启尝试移到查找循环之前#1976
Conversation
There was a problem hiding this comment.
嗨——我发现了 1 个问题
给 AI 智能体的提示
请处理本次代码审查中的评论:
## 单条评论
### 评论 1
<location path="tasks/Dokan/script_task.py" line_range="97-99" />
<code_context>
+ in_dokan, current_scene = self.get_current_scene(True)
+
+ # 进入道馆寻找界面后,在主循环前仅尝试一次开启道馆
+ if (in_dokan and
+ current_scene == DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN and
+ cfg.dokan_config.try_start_dokan):
+ count = self.update_remain_attack_count()
+ if count > 0:
</code_context>
<issue_to_address>
**道馆创建尝试被跳过**
如果任务启动时已经处于道馆界面,但缓存的截图已过时,未显示寻找道馆场景,那么 `get_current_scene(True)` 可能会将缓存帧判定为非寻找场景,因此此条件判断会跳过 `creat_dokan()`。主循环稍后会获取新帧并处理寻找道馆场景,但此时不再尝试创建道馆;用户会发现配置的开场尝试被跳过。
请在判断此条件前刷新截图,或者在主循环重新检测到寻找道馆场景后再进行这次单次尝试。
</issue_to_address>Sourcery 评估
等待批准。 请先处理 1 个问题。
阻塞性问题:tasks/Dokan/script_task.py:99
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/Dokan/script_task.py" line_range="97-99" />
<code_context>
+ in_dokan, current_scene = self.get_current_scene(True)
+
+ # 进入道馆寻找界面后,在主循环前仅尝试一次开启道馆
+ if (in_dokan and
+ current_scene == DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN and
+ cfg.dokan_config.try_start_dokan):
+ count = self.update_remain_attack_count()
+ if count > 0:
</code_context>
<issue_to_address>
**道馆创建尝试被跳过**
When the task starts already in a Dokan screen while the cached screenshot is stale and does not show the finding scene, `get_current_scene(True)` can classify a cached frame as a non-finding scene, so this guard skips `creat_dokan()`. The main loop later captures a fresh frame and handles the finding scene, but no longer attempts creation there; users see the configured opening attempt skipped.
Refresh the screenshot before evaluating this guard, or make the one-shot attempt after the main loop has freshly detected the finding scene.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: tasks/Dokan/script_task.py:99
| if (in_dokan and | ||
| current_scene == DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN and | ||
| cfg.dokan_config.try_start_dokan): |
There was a problem hiding this comment.
🟡 中等 · 道馆创建尝试被跳过
如果任务启动时已经处于道馆界面,但缓存的截图已过时,未显示寻找道馆场景,那么 get_current_scene(True) 可能会将缓存帧判定为非寻找场景,因此此条件判断会跳过 creat_dokan()。主循环稍后会获取新帧并处理寻找道馆场景,但此时不再尝试创建道馆;用户会发现配置的开场尝试被跳过。
请在判断此条件前刷新截图,或者在主循环重新检测到寻找道馆场景后再进行这次单次尝试。
给 AI 智能体的提示
在 `tasks/Dokan/script_task.py` 第 97-99 行:
**道馆创建尝试被跳过**
如果任务启动时已经处于道馆界面,但缓存的截图已过时,未显示寻找道馆场景,那么 `get_current_scene(True)` 可能会将缓存帧判定为非寻找场景,因此此条件判断会跳过 `creat_dokan()`。主循环稍后会获取新帧并处理寻找道馆场景,但此时不再尝试创建道馆;用户会发现配置的开场尝试被跳过。
请在判断此条件前刷新截图,或者在主循环重新检测到寻找道馆场景后再进行这次单次尝试。Original comment in English
🟡 Medium · 道馆创建尝试被跳过
When the task starts already in a Dokan screen while the cached screenshot is stale and does not show the finding scene, get_current_scene(True) can classify a cached frame as a non-finding scene, so this guard skips creat_dokan(). The main loop later captures a fresh frame and handles the finding scene, but no longer attempts creation there; users see the configured opening attempt skipped.
Refresh the screenshot before evaluating this guard, or make the one-shot attempt after the main loop has freshly detected the finding scene.
Prompt for AI agents
In `tasks/Dokan/script_task.py` at lines 97-99:
**道馆创建尝试被跳过**
When the task starts already in a Dokan screen while the cached screenshot is stale and does not show the finding scene, `get_current_scene(True)` can classify a cached frame as a non-finding scene, so this guard skips `creat_dokan()`. The main loop later captures a fresh frame and handles the finding scene, but no longer attempts creation there; users see the configured opening attempt skipped.
Refresh the screenshot before evaluating this guard, or make the one-shot attempt after the main loop has freshly detected the finding scene.
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.
|
变更
#1975 上个PR把周一创建道馆的限制删除后,由于创建位于查找阴阳寮循环的开头,如果选择挑战的阴阳寮被攻破,会循环 创建道馆-尝试攻破失败-回到查找阴阳寮循环-创建 ,由于上个pr已被合并,故新提了PR,把创建道馆独立于查找循环前。
try_start_dokan开启且剩余挑战次数大于 0 时,在主循环前尝试开启道馆一次。验证
git diff --check通过。Sourcery 总结
在进入寻找道场的循环之前,先尝试打开一次符合条件的道场。
Bug 修复:
增强功能:
Original summary in English
Summary by Sourcery
Attempt to open an eligible dojo once before entering the dojo-finding loop.
Bug Fixes:
Enhancements: