WilliamHarlow

4

Sep 3rd, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 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. int x;
  14. int y;
  15. int clicks = 1;
  16.  
  17. bool bClick = false;
  18.  
  19. while (true)
  20. {
  21. //toggles it on and off
  22. if (GetAsyncKeyState('U') &1)
  23. bClick = !bClick;
  24. if (bClick) {
  25.  
  26.  
  27. while (GetAsyncKeyState(VK_LBUTTON) < 0) {
  28.  
  29.  
  30.  
  31.  
  32.  
  33. INPUT input[2] = {};
  34.  
  35. input[0].type = INPUT_MOUSE;
  36. input[0].mi.dx = x;
  37. input[0].mi.dy = y;
  38. input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
  39.  
  40. input[1] = input[0];
  41. input[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;
  42.  
  43. SendInput(2, input, sizeof(INPUT));
  44.  
  45. std::cout << "Clicked ";
  46. std::cout << clicks++;
  47. std::cout << " times \n";
  48. Sleep(1000/cps);
  49. if (GetAsyncKeyState(VK_ESCAPE))
  50. {
  51. break;
  52. }
  53. }
  54. }
  55. }
  56. }
  57.  
  58.  
  59.  
  60.  
Advertisement
Add Comment
Please, Sign In to add comment