Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6. //Sub to https://www.youtube.com/channel/UCHWpwWJaF-gRCOmyZtQml8A
  7.  
  8. int x=0, y=0, cps;
  9. bool click=false;
  10.  
  11. void Menu()
  12. {
  13. cout << "Aggiungi i CPS:" << endl;
  14. cin >> cps;
  15. }
  16. void Clicker()
  17. {
  18. while (1)
  19. {
  20. if(GetAsyncKeyState(VK_LBUTTON)) // Left button of the mouse
  21. {
  22. click = true;
  23. }
  24.  
  25. if(GetAsyncKeyState(VK_RBUTTON)) //Right button of the mouse
  26. {
  27. click = false;
  28. }
  29.  
  30. if(click == true)
  31. {
  32. mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0 , 0);
  33. mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0 , 0);
  34. Sleep(1000/cps);
  35. }
  36. }
  37. }
  38. int main()
  39. {
  40. Menu();
  41. Clicker();
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement