feat(PinkPawHeist): 增加粉爪策略二后台版本#242
Open
fangfengfen wants to merge 1 commit into
Open
Conversation
Reviewer's Guide添加了一个支持后台运行的 PinkPawHeist 策略变体,使用 Win32-Background 控制器运行。该变体包括新的 pipeline / 任务定义,以及一个自定义的后台点击动作,该动作同时支持基于 OCR 区域和可配置坐标的点击,并通过 interface.json 接线,这样在使用桌面后台控制器时,该任务会出现在界面中。 PinkPawBGClick 后台点击自定义动作的时序图sequenceDiagram
actor Framework
participant PinkPawBGClick
participant Context
participant Controller
participant Job
Framework ->> PinkPawBGClick: run(context, argv)
activate PinkPawBGClick
PinkPawBGClick ->> PinkPawBGClick: [derive x,y from argv.box or custom_action_param]
PinkPawBGClick ->> Context: bg_click_at(context, x, y)
activate Context
Context ->> Controller: post_click(x, y)
activate Controller
Controller -->> Context: Job
deactivate Controller
Context ->> Job: wait()
activate Job
Job -->> Context: succeeded
deactivate Job
Context -->> PinkPawBGClick: bool
deactivate Context
PinkPawBGClick -->> Framework: RunResult(success)
deactivate PinkPawBGClick
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience前往你的 dashboard 来:
Getting HelpOriginal review guide in EnglishReviewer's GuideAdds a background-capable variant of the PinkPawHeist strategy that runs with the Win32-Background controller, including a new pipeline/task definition and a custom background click action that works with both OCR boxes and configurable coordinates, plus wiring into interface.json so the task appears when using the desktop background controller. Sequence diagram for PinkPawBGClick background click custom actionsequenceDiagram
actor Framework
participant PinkPawBGClick
participant Context
participant Controller
participant Job
Framework ->> PinkPawBGClick: run(context, argv)
activate PinkPawBGClick
PinkPawBGClick ->> PinkPawBGClick: [derive x,y from argv.box or custom_action_param]
PinkPawBGClick ->> Context: bg_click_at(context, x, y)
activate Context
Context ->> Controller: post_click(x, y)
activate Controller
Controller -->> Context: Job
deactivate Controller
Context ->> Job: wait()
activate Job
Job -->> Context: succeeded
deactivate Job
Context -->> PinkPawBGClick: bool
deactivate Context
PinkPawBGClick -->> Framework: RunResult(success)
deactivate PinkPawBGClick
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我提供了一些整体性的反馈:
- 在根据
argv.box推导坐标时,你只校验了box.w,并假设box.h一定存在;建议在使用前检查hasattr(box, 'h')且box.h > 0,以避免潜在的属性错误或无效的点击位置。 custom_action_param的解析逻辑目前比较复杂;可以考虑抽取成一个小的辅助函数(清晰处理 dict 与 JSON 字符串,以及嵌套的custom_action_param),这样能提升可读性,并减少未来扩展时出错的可能性。
面向 AI Agent 的提示词
Please address the comments from this code review:
## Overall Comments
- When deriving coordinates from `argv.box`, you only validate `box.w` and assume `box.h` exists; consider checking `hasattr(box, 'h')` and `box.h > 0` before using it to avoid potential attribute errors or invalid click positions.
- The `custom_action_param` parsing logic is fairly complex; extracting it into a small helper (with clear handling for dict vs JSON string and nested `custom_action_param`) would improve readability and make future extensions less error-prone.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- When deriving coordinates from
argv.box, you only validatebox.wand assumebox.hexists; consider checkinghasattr(box, 'h')andbox.h > 0before using it to avoid potential attribute errors or invalid click positions. - The
custom_action_paramparsing logic is fairly complex; extracting it into a small helper (with clear handling for dict vs JSON string and nestedcustom_action_param) would improve readability and make future extensions less error-prone.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- When deriving coordinates from `argv.box`, you only validate `box.w` and assume `box.h` exists; consider checking `hasattr(box, 'h')` and `box.h > 0` before using it to avoid potential attribute errors or invalid click positions.
- The `custom_action_param` parsing logic is fairly complex; extracting it into a small helper (with clear handling for dict vs JSON string and nested `custom_action_param`) would improve readability and make future extensions less error-prone.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Hollow-YK
suggested changes
May 30, 2026
| "class_regex": "UnrealWindow", | ||
| "window_regex": "^\\s*(异环|NTE)\\s*$", | ||
| "screencap": "PrintWindow", | ||
| "screencap": "Background", |
Contributor
There was a problem hiding this comment.
用的win32-background控制器为什么改win32控制器的截图方式
| @@ -109,6 +109,7 @@ | |||
| // group:HethereauHobbies | |||
008c6df to
bb8a862
Compare
bb8a862 to
e22c327
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
增加粉爪大劫案策略二的后台版本,使用 Win32-Background 控制器,支持窗口最小化运行。
改动内容
PinkPawHeistBG后台版任务定义和 pipelinepinkpaw_bg_clickcustom action(后台点击)interface.json添加后台版任务 import使用说明
Summary by Sourcery
使用 Win32-Background 控制器以及相应的任务/流水线定义,添加支持后台运行的 PinkPawHeist 策略版本。
新功能:
pinkpaw_bg_click自定义动作,基于 OCR 识别框或备用坐标,通过controller.post_click执行后台点击。改进:
Original summary in English
Summary by Sourcery
Add a background-capable version of the PinkPawHeist strategy using the Win32-Background controller and corresponding task/pipeline definitions.
New Features:
Enhancements: