Advertisement
WilliamHarlow

asd

Aug 27th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3. using namespace std;
  4.  
  5. int cps;
  6.  
  7. int main()
  8. {
  9. cout << "CPS?\n";
  10. cin >> cps;
  11. INPUT input{ 0 };
  12. input.type = INPUT_MOUSE;
  13.  
  14. bool bClick = false;
  15.  
  16. while (true)
  17. {
  18. //toggles it on and off
  19. if (GetAsyncKeyState('U') &1)
  20. bClick = !bClick;
  21.  
  22. if (bClick)
  23. {
  24. input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
  25. SendInput(1, &input, sizeof(INPUT));
  26. input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
  27. SendInput(1, &input, sizeof(INPUT));
  28. Sleep(1000/cps);
  29.  
  30. }
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement