Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- using namespace std;
- int cps;
- int main()
- {
- cout << "CPS?\n";
- cin >> cps;
- INPUT input{0};
- input.type = INPUT_MOUSE;
- int x;
- int y;
- int clicks = 1;
- bool bClick = false;
- while (true)
- {
- //toggles it on and off
- if (GetAsyncKeyState('U') &1)
- bClick = !bClick;
- if (bClick) {
- while (GetAsyncKeyState(VK_LBUTTON) < 0) {
- INPUT input[2] = {};
- input[0].type = INPUT_MOUSE;
- input[0].mi.dx = x;
- input[0].mi.dy = y;
- input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
- input[1] = input[0];
- input[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;
- SendInput(2, input, sizeof(INPUT));
- std::cout << "Clicked ";
- std::cout << clicks++;
- std::cout << " times \n";
- Sleep(1000/cps);
- if (GetAsyncKeyState(VK_ESCAPE))
- {
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment