新手启示者
谁能找到这个连点器代码的问题,就把豆子给谁!!!(我自己心知肚明)
#include<algorithm>
#include<iostream>
#include <windows.h>
#include <cstdio>
#include <ctime>
#include <cmath>
#include "conio.h"
#define pause_key VK_INSRT
#define pause_name ""
#define key_dw(key_name) ((GetAsyncKeyState(key_name)) ? 1 : 0)
using namespace std;
int n;
int p;
char a;
int che;
void init() {
SetWindowPos(GetConsoleWindow(), HWND_TOPMOST, 300, 100, 100, 100, SWP_NOSIZE);
DWORD mode;
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &mode);
mode &= ~ENABLE_QUICK_EDIT_MODE;
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), mode);
SetWindowLong(GetConsoleWindow(), GWL_STYLE, GetWindowLong(GetConsoleWindow(), GWL_STYLE) & ~WS_CAPTION);
}
int main(){
init();
SetWindowPos(GetConsoleWindow(), HWND_TOPMOST, 500, 500, 500, 500, SWP_NOMOVE);
system("color F8");
cout<<"请";
Sleep(120);
cout<<"输";
Sleep(120);
cout<<"入";
Sleep(120);
cout<<"点";
Sleep(120);
cout<<"击";
Sleep(120);
cout<<"类";
Sleep(120);
cout<<"型 (1=无限次,长按w停止(内测中,不稳定),2=自定义次数";
Sleep(120);
cout<<":"<<endl;
cin>>che;
if(che==2){
system("cls");
cout<<"请";
Sleep(120);
cout<<"输";
Sleep(120);
cout<<"入";
Sleep(120);
cout<<"点";
Sleep(120);
cout<<"击";
Sleep(120);
cout<<"次";
Sleep(120);
cout<<"数";
Sleep(120);
cout<<":"<<endl;
cin>>n;
system("cls");
cout<<"请";
Sleep(120);
cout<<"输";
Sleep(120);
cout<<"入";
Sleep(120);
cout<<"点";
Sleep(120);
cout<<"击";
Sleep(120);
cout<<"类";
Sleep(120);
cout<<"型 (r=右键,l=左键)";
Sleep(120);
cout<<":"<<endl;
cin>>a;
system("cls");
cout<<"请";
Sleep(120);
cout<<"输";
Sleep(120);
cout<<"入";
Sleep(120);
cout<<"点";
Sleep(120);
cout<<"击";
Sleep(120);
cout<<"间";
Sleep(120);
cout<<"隔";
Sleep(120);
cout<<":"<<endl;
cin>>p;
system("cls");
cout<<"请把鼠标放在位置上";
Sleep(500);
system("cls");
cout<<"3" ;
Sleep(500);
system("cls");
cout<<"2";
Sleep(500);
system("cls");
cout<<"1";
Sleep(500);
system("cls");
cout<<"点击中...";
if(a=='l'||a=='L'){
for(int i=1;i<=n;i++){
mouse_event(MOUSEEVENTF_LEFTUP | MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(p);
}
} else if(a=='r'||a=='R'){
for(int i=1;i<=n;i++){
mouse_event(MOUSEEVENTF_RIGHTUP | MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
Sleep(p);
}
}
}else if(che==1){
system("cls");
cout<<"请";
Sleep(120);
cout<<"输";
Sleep(120);
cout<<"入";
Sleep(120);
cout<<"点";
Sleep(120);
cout<<"击";
Sleep(120);
cout<<"类";
Sleep(120);
cout<<"型 (r=右键,l=左键)";
Sleep(120);
cout<<":"<<endl;
cin>>a;
system("cls");
cout<<"请";
Sleep(80);
cout<<"输";
Sleep(120);
cout<<"入";
Sleep(120);
cout<<"点";
Sleep(120);
cout<<"击";
Sleep(120);
cout<<"间";
Sleep(120);
cout<<"隔";
Sleep(120);
cout<<":"<<endl;
cin>>p;
system("cls");
cout<<"请把鼠标放在位置上";
Sleep(500);
system("cls");
cout<<"3" ;
Sleep(500);
system("cls");
cout<<"2";
Sleep(500);
system("cls");
cout<<"1";
Sleep(500);
system("cls");
cout<<"点击中...";
if(a=='l'||a=='L'){
for(;;){
mouse_event(MOUSEEVENTF_LEFTUP | MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(p);
if(kbhit()){
break;
}
}
} else if(a=='r'||a=='R'){
for(;;){
mouse_event(MOUSEEVENTF_RIGHTUP | MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
Sleep(p);
if(kbhit()){
break;
}
}
}
}
return 0;
}
高级启示者
https://wenda.codingtang.com/questions/16803/
用这个不香吗
低情商:这个哪里错了,给20豆
高情商:帮我找错误,奖励20豆
(不要SetCursorPos吗)
新手启示者
不讲武德
直接用这个不香吗
#include<stdio.h>
#include<windows.h>
int main() {
while(1) {
if(GetAsyncKeyState(VK_SPACE))//按下空格,开始执行
{
while(1)
{
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTUP,0,0,0,0);//当前位置
//点击一次鼠标
Sleep(1);//每0.5秒点击一次
if(GetAsyncKeyState(VK_ESCAPE))
return 0; //按esc退出
}
}
}
return 0;
}