c++“大魔丸”连点器

· · 科技·工程

c++连点器代码:

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
    cout << "欢迎使用“大魔丸”连点器!\n";
    Sleep(1000);
    cout << "加载中...";
    Sleep(2000);
    for(int i = 1; i <= 6; i ++) cout << "...", Sleep(5000);
    cout << "\n";
    cout << "可以开始使用了!\n";
    Sleep(500);
    cout << "按下 X 连点鼠标左键,按下 Z 连点鼠标右键,祝您使用愉快。\n";
    while(1){
        if(GetAsyncKeyState('X') & 0x8000) {
            srand(time(0));
            mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
            Sleep((2 * rand() + rand() * rand() + 1) % 3);
            mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
            Sleep((2 * rand() + rand() * rand() + 1) % 3);
        }
        if(GetAsyncKeyState('Z') & 0x8000) {
            srand(time(0));
            mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
            Sleep((2 * rand() + rand() * rand() + 1) % 3);
            mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
            Sleep((2 * rand() + rand() * rand() + 1) % 3);
        }
    }
}