WilliamHarlow

AUTOCLICKER - sendinput test

Aug 27th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3. #include <string>
  4. using namespace std;
  5. /* colors for rainbow
  6. 0 = Black
  7. 1 = Blue
  8. 2 = Green
  9. 3 = Aqua
  10. 4 = Red
  11. 5 = Purple
  12. 6 = Yellow
  13. 7 = White
  14. 8 = Gray
  15. 9 = Light Blue
  16. A = Light Green
  17. B = Light Aqua
  18. C = Light Red
  19. D = Light Purple
  20. E = Light Yellow
  21. F = Bright White
  22. 7 = F = bright white white
  23. system("color 02");For example, this is black green text
  24. */
  25. int x = 0, y = 0, cps;
  26. bool click = false;
  27. string rl;
  28.  
  29. void BootMenu()
  30. {
  31. cout << " oOOOOo oOo .o000o. .o000o. .oOOOo. \n";
  32. cout << "OO OO OOO OO OO OO OO OO OO \n";
  33. cout << "OO .o OOO OO OO OO OO OO OO \n";
  34. cout << "OO.oo OOO OO OO OO OO OO OO \n";
  35. cout << "OO.oo OOO OO OO OO OO OOoOoO \n";
  36. cout << "OO o. OOO OO OO OO OO OO \n";
  37. cout << "OO OO OOO OO OO OO OO OO \n";
  38. cout << "OO Oo OOO OO OO OO OO OO \n";
  39. cout << " oOOOOo OOO OooooO OoooO OO \n"; //picture art for start.
  40.  
  41. cout << "\n \n \n";
  42. cout << " " << endl;
  43. cout << " " << endl;
  44. system("color 04");
  45. cout << "Booting up";
  46. Sleep(300);
  47. system("color 06");
  48. cout << ".";
  49. Sleep(250);
  50. system("color 02");
  51. cout << ".";
  52. Sleep(200);
  53. system("color 03");
  54. cout << ".\n";
  55. cout << "Bloopclicker v2 \n made by Bloopdog himself. \n";
  56. system("color 01");
  57. cout << "Toggle on key is up arrow, toggle off key is down arrow. \n ";
  58. system("color 04"); // makes the background black and text red
  59.  
  60. }
  61.  
  62. void LeftClicker() { // leftclicking function
  63.  
  64. while (1) { //while 1, so basically forever
  65. if (GetAsyncKeyState(VK_DOWN<0)) //checks for down arrow being pressed
  66. {
  67. click = true; //if down arrow pressed, turns click bool to true
  68. }
  69. if (GetAsyncKeyState(VK_UP>=0)) //checks for up arrow
  70. {
  71. click = false; //if up arrow is pressed, changes "click" bool to false, meaning it restarts function
  72. }
  73.  
  74. if(click) { //when click is true, checks for left click, and if left click is pressed, it will start clicking
  75. // as fast as you set it (probably lower because the cps is the denom for 1000, to get the actual cps)
  76. if (GetAsyncKeyState(VK_LBUTTON < 0))
  77. INPUT input[2] = {};
  78.  
  79. input[0].type = INPUT_MOUSE;
  80. input[0].mi.dx = x;
  81. input[0].mi.dy = y;
  82. input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
  83. input[1] = input[0];
  84. input[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;
  85. SendInput(2, input, sizeof(INPUT));
  86. Sleep(1000 / cps);
  87.  
  88. }
  89.  
  90. }
  91.  
  92.  
  93.  
  94. }
  95.  
  96.  
  97.  
  98.  
  99.  
  100. void RightClicker() { //right click function, same as left click so im not labelling what it does.
  101.  
  102.  
  103.  
  104. while (1) {
  105. if (GetAsyncKeyState(VK_DOWN<0))
  106. {
  107. click = true;
  108. }
  109. if (GetAsyncKeyState(VK_UP>=0))
  110. {
  111. click = false;
  112. }
  113.  
  114. if(click) { //when click is true, checks for left click, and if left click is pressed, it will start clicking
  115. // as fast as you set it (probably lower because the cps is the denom for 1000, to get the actual cps)
  116. if (GetAsyncKeyState(VK_RBUTTON < 0))
  117. INPUT input[2] = {};
  118.  
  119. input[0].type = INPUT_MOUSE;
  120. input[0].mi.dx = x;
  121. input[0].mi.dy = y;
  122. input[0].mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
  123. input[1] = input[0];
  124. input[1].mi.dwFlags = MOUSEEVENTF_RIGHTUP;
  125. SendInput(2, input, sizeof(INPUT));
  126. Sleep(1000 / cps);
  127.  
  128. }
  129. }
  130.  
  131. }
  132.  
  133.  
  134.  
  135. }
  136.  
  137.  
  138.  
  139.  
  140. void Rl() {
  141.  
  142. cout << "Right or Left Clicker? (Left, left or just l) \n";
  143. cin >> rl; //gets users input for whether they want left or right
  144. if (rl == "Left", "left", "l", "L","lefy","lwft","lef","let","not right","Left click","left click", "LEFTCLICK","legt","lefr") {
  145. // if user types any of these strings, it will get the users input for
  146. // the cps, then goes to the function corresponding with what choice they made.
  147. cout << "\n Add cps \n>>";
  148. cin >> cps;
  149. cout << "cps is taken and divides 1k to get a slightly randomized click speed, it can also be affected by your pc's speed. \n";
  150. cout << "You'll be clicking around:";
  151. cout << cps; << " clicks per second";
  152. LeftClicker;
  153. }
  154. else {
  155. cout << "Right it is! \n"; //if anything other than those certain strings was chosen, gets cps for right click, and goes to right click
  156. cout << "Add cps \n>>"; //func
  157. cin >> cps;
  158. RightClicker;
  159. }
  160.  
  161. }
  162.  
  163. int main()
  164. {
  165.  
  166. BootMenu(); // goes to bootmenu
  167. Rl(); //goes ot right or left choice // system("pause") keeps it open until i press any key. //cin.ignore();
  168.  
  169. }
Advertisement
Add Comment
Please, Sign In to add comment