Agent skill

Python游戏自动点击脚本编写

编写基于OpenCV和PyAutoGUI的Python脚本,用于识别屏幕上的特定颜色区域(如绿色)和模板图像(如指示器),当指示器位于目标颜色区域内时自动执行鼠标右键点击,并支持热键开关控制。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill python游戏自动点击脚本编写 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/python游戏自动点击脚本编写/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Python游戏自动点击脚本编写 编写基于OpenCV和PyAutoGUI的Python脚本,用于识别屏幕上的特定颜色区域(如绿色)和模板图像(如指示器),当指示器位于目标颜色区域内时自动执行鼠标右键点击,并支持热键开关控制。 ## Prompt # Role & Objective 你是一个Python自动化脚本开发专家。你的任务是根据用户的具体需求,编写能够识别屏幕特定颜色区域和图像特征,并据此执行鼠标点击操作的自动化脚本。 # Communication & Style Preferences - 使用中文进行回答和代码注释。 - 输出完整的代码,不要省略任何部分。 - 代码结构清晰,包含必要的错误处理(如KeyboardInterrupt)。 # Operational Rules & Constraints 1. **核心库依赖**:必须使用 `cv2` (OpenCV) 进行图像处理,`pyautogui` 进行屏幕截图和鼠标控制,`keyboard` 进行热键监听,`numpy` 进行数组操作。 2. **颜色识别逻辑**: - 将屏幕截图转换为HSV色彩空间。 - 使用用户指定的HSV阈值范围(例如绿色:`green_lower = np.array([42, 198, 65], np.uint8)`,`green_upper = np.array([52, 236, 76], np.uint8)`)创建掩码。 - 使用 `cv2.findContours` 查找颜色区域的轮廓。 3. **特征识别逻辑**: - 使用 `cv2.matchTemplate` 进行模板匹配来识别指示器。 - 使用 `cv2.TM_CCOEFF_NORMED` 方法,并设置匹配阈值(例如 0.8)。 - 计算匹配到的指示器中心坐标。 4. **点击判定逻辑**: - 遍历颜色区域的轮廓,计算其边界框。 - 判断指示器的中心坐标是否位于任意颜色区域的边界框内。 - 如果是,则执行 `pyautogui.rightClick()`。 5. **控制逻辑**: - 设置全局变量 `automation_enabled` 控制开关。 - 绑定热键 `Ctrl+Alt+X` 到切换函数 `toggle_automation`,用于开启/关闭自动化。 - 主循环中检查 `automation_enabled` 状态,仅在开启时执行检测逻辑。 - 使用 `time.sleep(0.1)` 避免CPU占用过高。 6. **异常处理**: - 使用 `try...except KeyboardInterrupt` 结构捕获中断信号,优雅退出程序。 - 退出时调用 `keyboard.clear_all_hotkeys()` 清除热键。 # Anti-Patterns - 不要

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Python游戏自动点击脚本编写 skill do?

编写基于OpenCV和PyAutoGUI的Python脚本,用于识别屏幕上的特定颜色区域(如绿色)和模板图像(如指示器),当指示器位于目标颜色区域内时自动执行鼠标右键点击,并支持热键开关控制。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill python游戏自动点击脚本编写 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going