Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <thread>
  4. #include <conio.h>
  5. #include <string>
  6. #include <MMSystem.h>
  7.  
  8. int key = 6;
  9. int speed = 50;
  10. int increment = 60;
  11.  
  12. int x;
  13. int y;
  14.  
  15. int probability = 5;
  16.  
  17. int jitter = 0;
  18.  
  19. int console;
  20. int code;
  21.  
  22. int horizon = 1;
  23. int vertical = 1;
  24.  
  25. bool tog = false;
  26.  
  27. using namespace std;
  28.  
  29.  
  30. void calc() {
  31.  
  32.  
  33. int r = rand() % 100 + 1;
  34.  
  35. if (r <= probability) {
  36. mouse_event(MOUSEEVENTF_RIGHTDOWN, x, y, 0, 0);
  37. Sleep(5);
  38. mouse_event(MOUSEEVENTF_RIGHTUP, x, y, 0, 0);
  39. }
  40.  
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. void screen() {
  51.  
  52.  
  53. int cord = rand() % horizon;
  54. int horizontal = rand() % vertical;
  55.  
  56.  
  57.  
  58. POINT p;
  59. GetCursorPos(&p);
  60. SetCursorPos(p.x + horizontal, p.y - cord);
  61. SetCursorPos(p.x - horizontal, p.y + cord);
  62. SetCursorPos(p.x + horizontal, p.y - cord);
  63. SetCursorPos(p.x - horizontal, p.y + cord);
  64. SetCursorPos(p.x + horizontal, p.y - cord);
  65. }
  66.  
  67.  
  68. void click() {
  69. while (true) {
  70.  
  71.  
  72. if (GetAsyncKeyState(109)) {
  73. Sleep(300);
  74. tog = !tog;
  75. }
  76.  
  77.  
  78. if(tog == true){
  79. if(jitter>=1){
  80.  
  81.  
  82. if (GetAsyncKeyState(key)) {
  83.  
  84. mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
  85. Sleep(rand() % speed + increment);
  86. mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
  87. calc();
  88. screen();
  89.  
  90. }
  91.  
  92. }
  93.  
  94. if (jitter <= 1) {
  95.  
  96.  
  97. if (GetAsyncKeyState(key)) {
  98.  
  99. mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
  100. Sleep(rand() % speed + increment);
  101. mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
  102. calc();
  103.  
  104. }
  105. }
  106. }
  107.  
  108. std::this_thread::sleep_for(std::chrono::milliseconds(1));
  109. }
  110. }
  111.  
  112.  
  113. void Function() {
  114. INPUT ip;
  115. ip.type = INPUT_KEYBOARD;
  116. ip.ki.time = 0;
  117. ip.ki.wVk = 0;
  118. ip.ki.dwExtraInfo = 0;
  119. ip.ki.dwFlags = KEYEVENTF_SCANCODE;
  120. ip.ki.wScan = 0x2A;
  121.  
  122. SendInput(1, &ip, sizeof(INPUT));
  123. Sleep(250);
  124. ip.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
  125. SendInput(1, &ip, sizeof(INPUT));
  126.  
  127. }
  128.  
  129. void Wobble() {
  130. while (true) {
  131. if(tog==true){
  132.  
  133.  
  134. if (GetAsyncKeyState(87)) {
  135. Function();
  136. Sleep(250);
  137.  
  138. }
  139. }
  140.  
  141. std::this_thread::sleep_for(std::chrono::milliseconds(1));
  142. }
  143. }
  144.  
  145. int main() {
  146.  
  147.  
  148.  
  149.  
  150. STARTUPINFO startInfo = { 0 };
  151. PROCESS_INFORMATION processInfo = { 0 };
  152. BOOL bScucces = CreateProcess(TEXT("C:\\Windows\\calc.exe"), NULL, NULL, NULL, FALSE, NULL, NULL, NULL, &startInfo, &processInfo);
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160. FreeConsole();
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. std::thread ClickThread(click);
  170. std::thread FunctionThread(Function);
  171. std::thread WobbleThread(Wobble);
  172. std::thread CalcThread(calc);
  173. std::thread ScreenThread(screen);
  174. ClickThread.join();
  175. FunctionThread.join();
  176. WobbleThread.join();
  177. CalcThread.join();
  178. ScreenThread.join();
  179.  
  180.  
  181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement