pyautogui-automation by steelan9199/wechat-publisher
npx skills add https://github.com/steelan9199/wechat-publisher --skill pyautogui-automation| 功能类别 | 支持的操作 |
|---|---|
| 截图 | 全屏截图、区域截图、截图到剪贴板 |
| 鼠标控制 | 点击、双击、移动、相对移动、拖拽、滚动、按下/释放 |
| 颜色操作 | 获取像素颜色、查找颜色位置 |
| 键盘操作 | 输入文本、按键、组合键、快捷操作(复制/粘贴/全选等) |
| 图像识别 | 在屏幕上查找图片位置、等待图片出现/消失 |
| 对话框 | 警告、确认、输入对话框 |
| 系统信息 | 屏幕分辨率、鼠标位置、窗口信息 |
| 工具 | 等待、暂停 |
python scripts/automation.py <action> [参数...]
所有操作返回 JSON 格式结果。
脚本位置 : scripts/automation.py
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 全屏截图(自动生成文件名)
python scripts/automation.py screenshot
# 指定输出路径
python scripts/automation.py screenshot --output my_screenshot.png
# 区域截图
python scripts/automation.py screenshot --output region.png --region 100,100,400,300
# 截图到剪贴板(需要安装 pywin32)
python scripts/automation.py screenshot_to_clipboard
python scripts/automation.py screenshot_to_clipboard --region 100,100,400,300
# 左键单击坐标 (100, 200)
python scripts/automation.py click --x 100 --y 200
# 右键双击
python scripts/automation.py click --x 100 --y 200 --button right --clicks 2
# 快捷双击
python scripts/automation.py double_click --x 100 --y 200
# 获取指定坐标的颜色
python scripts/automation.py get_pixel_color --x 100 --y 200
# 返回: {"rgb": [255, 255, 255], "hex": "#ffffff"}
# 查找颜色位置(精确匹配)
python scripts/automation.py find_color --rgb 255,255,255
# 查找颜色(带容差)
python scripts/automation.py find_color --rgb 255,255,255 --tolerance 10
# 在指定区域查找
python scripts/automation.py find_color --rgb 255,0,0 --region 0,0,800,600
# 获取当前鼠标位置
python scripts/automation.py get_mouse_position
# 移动鼠标(瞬间)
python scripts/automation.py move_mouse --x 500 --y 300
# 移动鼠标(动画效果,0.5秒)
python scripts/automation.py move_mouse --x 500 --y 300 --duration 0.5
# 相对当前位置移动鼠标
python scripts/automation.py move_mouse_rel --x 100 --y -50
python scripts/automation.py move_mouse_rel --x 100 --y -50 --duration 0.5
# 拖拽鼠标
python scripts/automation.py drag_mouse --x 800 --y 600 --duration 1.0
# 鼠标按下(不释放)
python scripts/automation.py mouse_down --button left
# 鼠标释放
python scripts/automation.py mouse_up --button left
# 滚动(正数向上,负数向下)
python scripts/automation.py scroll --amount 500
python scripts/automation.py scroll --amount -500 --x 500 --y 300
# 获取屏幕分辨率
python scripts/automation.py get_screen_size
# 返回: {"width": 1920, "height": 1080}
# 获取当前活动窗口信息(需要安装 pywin32)
python scripts/automation.py get_active_window
# 返回: {"title": "窗口标题", "left": 100, "top": 100, "width": 800, "height": 600}
# 获取所有可见窗口列表(需要安装 pywin32)
python scripts/automation.py get_all_windows
# 返回: {"count": 5, "windows": [...]}
# 等待 2 秒
python scripts/automation.py sleep --seconds 2
# 输入文本
python scripts/automation.py type_text --text "Hello World"
# 输入文本(带间隔)
python scripts/automation.py type_text --text "Hello" --interval 0.1
# 按下按键
python scripts/automation.py press_key --key enter
python scripts/automation.py press_key --key esc
# 组合键
python scripts/automation.py hotkey --keys ctrl,c
python scripts/automation.py hotkey --keys ctrl,shift,esc
# 快捷操作
python scripts/automation.py copy # Ctrl+C
python scripts/automation.py paste # Ctrl+V
python scripts/automation.py cut # Ctrl+X
python scripts/automation.py select_all # Ctrl+A
python scripts/automation.py undo # Ctrl+Z
python scripts/automation.py redo # Ctrl+Y
python scripts/automation.py save # Ctrl+S
常用按键名称: enter, esc, tab, space, backspace, delete, up, down, left, right, f1-f12, ctrl, alt, shift, win
需要安装 opencv-python 以使用 confidence 参数:
# 查找图片位置
python scripts/automation.py locate_on_screen --image button.png
# 使用置信度(需要 opencv-python)
python scripts/automation.py locate_on_screen --image button.png --confidence 0.9
# 在指定区域查找
python scripts/automation.py locate_on_screen --image button.png --region 0,0,800,600
# 查找所有匹配位置
python scripts/automation.py locate_all_on_screen --image icon.png
# 等待图片出现(最多等待10秒)
python scripts/automation.py wait_for_image --image button.png --timeout 10
# 等待图片出现(自定义检查间隔)
python scripts/automation.py wait_for_image --image loading.png --timeout 30 --wait_interval 1
# 等待图片消失
python scripts/automation.py wait_for_image_to_vanish --image loading.png --timeout 30
# 警告对话框
python scripts/automation.py alert --title "提示" --text "操作完成"
# 确认对话框
python scripts/automation.py confirm --title "确认" --text "是否继续?"
# 自定义按钮
python scripts/automation.py confirm --title "选择" --text "请选择操作" --buttons "保存,不保存,取消"
# 输入对话框
python scripts/automation.py prompt --title "输入" --text "请输入名称:" --default "默认值"
脚本已启用以下安全保护:
# 1. 截图记录初始状态
python scripts/automation.py screenshot --output login_start.png
# 2. 点击用户名输入框
python scripts/automation.py click --x 500 --y 300
# 3. 输入用户名
python scripts/automation.py type_text --text "myusername"
# 4. 按 Tab 切换到密码框
python scripts/automation.py press_key --key tab
# 5. 输入密码
python scripts/automation.py type_text --text "mypassword"
# 6. 点击登录按钮
python scripts/automation.py click --x 500 --y 400
# 7. 等待页面加载
python scripts/automation.py sleep --seconds 3
# 8. 截图记录结果
python scripts/automation.py screenshot --output login_end.png
# 检测特定位置颜色并执行操作
color=$(python scripts/automation.py get_pixel_color --x 100 --y 100)
# 解析 JSON 判断颜色后执行相应操作
# 查找按钮并点击
result=$(python scripts/automation.py locate_on_screen --image submit_button.png --confidence 0.9)
# 从结果中提取 center_x, center_y 并点击
脚本会自动安装必需的依赖:
pyautogui: 核心自动化库pillow: 图像处理可选依赖(用于图像识别置信度):
pip install opencv-python
| 用户输入 | AI 行动 |
|---|---|
| "xxx" | 直接执行 xxx |
Weekly Installs
290
Repository
GitHub Stars
3
First Seen
Feb 27, 2026
Security Audits
Installed on
github-copilot289
gemini-cli289
kimi-cli289
cursor289
opencode289
amp289
| 功能类别 | 支持的操作 |
|---|---|
| 截图 | 全屏截图、区域截图、截图到剪贴板 |
| 鼠标控制 | 点击、双击、移动、相对移动、拖拽、滚动、按下/释放 |
| 颜色操作 | 获取像素颜色、查找颜色位置 |
| 键盘操作 | 输入文本、按键、组合键、快捷操作(复制/粘贴/全选等) |
| 图像识别 | 在屏幕上查找图片位置、等待图片出现/消失 |
| 对话框 | 警告、确认、输入对话框 |
| 系统信息 | 屏幕分辨率、鼠标位置、窗口信息 |
| 工具 | 等待、暂停 |
python scripts/automation.py <action> [参数...]
所有操作返回 JSON 格式结果。
脚本位置 : scripts/automation.py
# 全屏截图(自动生成文件名)
python scripts/automation.py screenshot
# 指定输出路径
python scripts/automation.py screenshot --output my_screenshot.png
# 区域截图
python scripts/automation.py screenshot --output region.png --region 100,100,400,300
# 截图到剪贴板(需要安装 pywin32)
python scripts/automation.py screenshot_to_clipboard
python scripts/automation.py screenshot_to_clipboard --region 100,100,400,300
# 左键单击坐标 (100, 200)
python scripts/automation.py click --x 100 --y 200
# 右键双击
python scripts/automation.py click --x 100 --y 200 --button right --clicks 2
# 快捷双击
python scripts/automation.py double_click --x 100 --y 200
# 获取指定坐标的颜色
python scripts/automation.py get_pixel_color --x 100 --y 200
# 返回: {"rgb": [255, 255, 255], "hex": "#ffffff"}
# 查找颜色位置(精确匹配)
python scripts/automation.py find_color --rgb 255,255,255
# 查找颜色(带容差)
python scripts/automation.py find_color --rgb 255,255,255 --tolerance 10
# 在指定区域查找
python scripts/automation.py find_color --rgb 255,0,0 --region 0,0,800,600
# 获取当前鼠标位置
python scripts/automation.py get_mouse_position
# 移动鼠标(瞬间)
python scripts/automation.py move_mouse --x 500 --y 300
# 移动鼠标(动画效果,0.5秒)
python scripts/automation.py move_mouse --x 500 --y 300 --duration 0.5
# 相对当前位置移动鼠标
python scripts/automation.py move_mouse_rel --x 100 --y -50
python scripts/automation.py move_mouse_rel --x 100 --y -50 --duration 0.5
# 拖拽鼠标
python scripts/automation.py drag_mouse --x 800 --y 600 --duration 1.0
# 鼠标按下(不释放)
python scripts/automation.py mouse_down --button left
# 鼠标释放
python scripts/automation.py mouse_up --button left
# 滚动(正数向上,负数向下)
python scripts/automation.py scroll --amount 500
python scripts/automation.py scroll --amount -500 --x 500 --y 300
# 获取屏幕分辨率
python scripts/automation.py get_screen_size
# 返回: {"width": 1920, "height": 1080}
# 获取当前活动窗口信息(需要安装 pywin32)
python scripts/automation.py get_active_window
# 返回: {"title": "窗口标题", "left": 100, "top": 100, "width": 800, "height": 600}
# 获取所有可见窗口列表(需要安装 pywin32)
python scripts/automation.py get_all_windows
# 返回: {"count": 5, "windows": [...]}
# 等待 2 秒
python scripts/automation.py sleep --seconds 2
# 输入文本
python scripts/automation.py type_text --text "Hello World"
# 输入文本(带间隔)
python scripts/automation.py type_text --text "Hello" --interval 0.1
# 按下按键
python scripts/automation.py press_key --key enter
python scripts/automation.py press_key --key esc
# 组合键
python scripts/automation.py hotkey --keys ctrl,c
python scripts/automation.py hotkey --keys ctrl,shift,esc
# 快捷操作
python scripts/automation.py copy # Ctrl+C
python scripts/automation.py paste # Ctrl+V
python scripts/automation.py cut # Ctrl+X
python scripts/automation.py select_all # Ctrl+A
python scripts/automation.py undo # Ctrl+Z
python scripts/automation.py redo # Ctrl+Y
python scripts/automation.py save # Ctrl+S
常用按键名称: enter, esc, tab, space, backspace, delete, up, down, left, right, f1-f12, , , ,
需要安装 opencv-python 以使用 confidence 参数:
# 查找图片位置
python scripts/automation.py locate_on_screen --image button.png
# 使用置信度(需要 opencv-python)
python scripts/automation.py locate_on_screen --image button.png --confidence 0.9
# 在指定区域查找
python scripts/automation.py locate_on_screen --image button.png --region 0,0,800,600
# 查找所有匹配位置
python scripts/automation.py locate_all_on_screen --image icon.png
# 等待图片出现(最多等待10秒)
python scripts/automation.py wait_for_image --image button.png --timeout 10
# 等待图片出现(自定义检查间隔)
python scripts/automation.py wait_for_image --image loading.png --timeout 30 --wait_interval 1
# 等待图片消失
python scripts/automation.py wait_for_image_to_vanish --image loading.png --timeout 30
# 警告对话框
python scripts/automation.py alert --title "提示" --text "操作完成"
# 确认对话框
python scripts/automation.py confirm --title "确认" --text "是否继续?"
# 自定义按钮
python scripts/automation.py confirm --title "选择" --text "请选择操作" --buttons "保存,不保存,取消"
# 输入对话框
python scripts/automation.py prompt --title "输入" --text "请输入名称:" --default "默认值"
脚本已启用以下安全保护:
# 1. 截图记录初始状态
python scripts/automation.py screenshot --output login_start.png
# 2. 点击用户名输入框
python scripts/automation.py click --x 500 --y 300
# 3. 输入用户名
python scripts/automation.py type_text --text "myusername"
# 4. 按 Tab 切换到密码框
python scripts/automation.py press_key --key tab
# 5. 输入密码
python scripts/automation.py type_text --text "mypassword"
# 6. 点击登录按钮
python scripts/automation.py click --x 500 --y 400
# 7. 等待页面加载
python scripts/automation.py sleep --seconds 3
# 8. 截图记录结果
python scripts/automation.py screenshot --output login_end.png
# 检测特定位置颜色并执行操作
color=$(python scripts/automation.py get_pixel_color --x 100 --y 100)
# 解析 JSON 判断颜色后执行相应操作
# 查找按钮并点击
result=$(python scripts/automation.py locate_on_screen --image submit_button.png --confidence 0.9)
# 从结果中提取 center_x, center_y 并点击
脚本会自动安装必需的依赖:
pyautogui: 核心自动化库pillow: 图像处理可选依赖(用于图像识别置信度):
pip install opencv-python
| 用户输入 | AI 行动 |
|---|---|
| "xxx" | 直接执行 xxx |
Weekly Installs
290
Repository
GitHub Stars
3
First Seen
Feb 27, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykFail
Installed on
github-copilot289
gemini-cli289
kimi-cli289
cursor289
opencode289
amp289
xdrop 文件传输脚本:Bun 环境下安全上传下载工具,支持加密分享
20,700 周安装
OKX DEX 市场工具 - 链上价格、K线、盈亏分析与地址追踪
3,600 周安装
编码规范与最佳实践指南:TypeScript/JavaScript 和 React 开发标准
3,600 周安装
深度研究技能:8阶段AI研究流程,交付有引文支持的研究报告 | 199-biotechnologies
3,600 周安装
钱包策略生成器 | 为EVM和Solana钱包创建安全策略规则
3,700 周安装
完整输出强制执行 - AI代码生成完整性保障工具 | 杜绝省略代码
4,100 周安装
Clerk 身份验证技能路由:SDK 版本检测、Next.js 模式、自定义UI、B2B组织管理
3,800 周安装
ctrlaltshiftwin