.fc
是便于企业微信/QQ自动化发送消息的自动化脚本 主要功能是通过模拟点击来进行消息发送 目的是更便捷的处理操作 发送消息等等
同时 此脚本也支持中文编写
.fc
是基于 JSON 的配置文件格式,包含两大核心模块:
{
"settings": {}, // 全局配置和变量声明
"scenarios": [] // 自动化场景流程定义
}
"settings": {
"global_interval": 0.1,
"app_window": "企业微信",
"button_positions": {
"search": [215, 100],
"confirm": [355, 342]
},
"group_id": "987654",
"hotkey_save": ["ctrl", "s"]
}
变量特性:
$变量名
调用(支持数组索引 $var[0]
)每个场景包含 窗口定位 和 操作步骤 两部分:
{
"window": {
"title": "$app_window",
"wait": 0.3
},
"steps": [/* 操作步骤 */]
}
支持 5 种基础操作类型 您可直接输入中文也可输入括号里的英文:
{
"action": "click",
"x": "$button_positions.search[0]",
"y": "$button_positions.search[1]",
"relative": true,
"clicks": 2,
"interval": 0.2,
"button": "left"
}
{
"action": "typewrite",
"text": "$group_id",
"interval": 0.05
}
{
"action": "hotkey",
"keys": "$hotkey_save"
}
{
"action": "drag",
"start_x": 100,
"start_y": 200,
"end_x": 300,
"end_y": 400,
"duration": 1.0
}
{
"action": "close"
}
global_interval
的 settings 键值都会存储为变量"$app_window"
,数组元素:"$button_positions.search[0]"
ValueError
;数组越界 → 抛出 IndexError
示例配置文件:
{
"settings": {
"global_interval": 0.1,
"window_titles": ["user"], // 这里设置需要发送对象的名称 例如:微信名 聊名等
"line_edit": [ 265, 555 ], // 聊天框的位置
"send_button": [ 164, 412 ],
"send_information": "test"
},
"scenarios": [
{
"window": {
"title": "$window_titles[0]",
"wait": 0.2
},
"steps": [
{
"action": "click",
"x": "$line_edit[0]",
"y": "$line_edit[1]",
"relative": true,
"duration": 0.1
},
{
"action": "typewrite",
"text": "$send_information",
"interval": 0.1
},
{
"action": "hotkey",
"keys": ["enter"],
"interval": 0.1
}
]
}
]
}
pyautogui.mouseInfo()
获取精确坐标pyautogui.PAUSE = 1
设置全局操作间隔便于观察WindowController
类中添加新的操作类型load {次数}
⚙️ 建议在虚拟机或测试环境中先行验证脚本,确保操作流程符合预期后再投入生产环境使用。