改进连点器c++ 不喜勿喷
2026-10-05 11:04:18
发布于:浙江





#include <iostream>
#include <windows.h>
#include <cstdio>
#include <conio.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1 : 0)
using namespace std;
int now = 0;
int flag = 0;
double cps = 15.0;
void click_left() {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
void click_right() {
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
}
void set_speed() {
system("cls");
cout << "当前模式: [" << (!flag ? "左键" : "右键") << "]" << endl;
cout << "请输入期望的 CPS (每秒点击次数, 例如 15): ";
cin >> cps;
if (cps <= 0) cps = 1;
if (cps > 1000) cps = 1000;
cout << "设置成功! 当前速度: " << cps << " CPS" << endl;
system("pause");
system("cls");
}
void show_status() {
}
int main() {
SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
cout << "============ 简易连点器 =============" << endl;
cout << "| 按 1 开始连点,按 2 停止连点 |" << endl;
cout << "| 按 F1 切换左键,按 F2 切换右键 |" << endl;
cout << "| 按 5 调速 (设置 CPS) |" << endl;
cout << "| 按 6 强制结束 |" << endl;
cout << "=====================================" << endl;
cout<<"请输入数字: ";
while (1) {
system("color 1c");
if (KEY_DOWN('1')) {
now = 1;
Sleep(200);
}
if (KEY_DOWN('2')) {
now = 0;
Sleep(200);
}
if (KEY_DOWN(VK_F1)) {
flag = 0;
cout << "\n[切换] 当前模式: 左键连点" << endl;
Sleep(200);
}
if (KEY_DOWN(VK_F2)) {
flag = 1;
cout << "\n[切换] 当前模式: 右键连点" << endl;
Sleep(200);
}
if (KEY_DOWN('5')) {
set_speed();
}
if (KEY_DOWN('6')) {
return 0;
}
if (now) {
if (!flag) {
click_left();
} else {
click_right();
}
double interval_ms = 1000.0 / cps;
int sleep_time = (int)(interval_ms);
if (sleep_time < 1) sleep_time = 1;
Sleep(sleep_time);
} else {
Sleep(10);
}
}
return 0;
}
全部评论 1
666
2天前 来自 浙江
0
















有帮助,赞一个