Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <cstdlib>
  4. #include <ctime>
  5. #include <thread>
  6. #include <Windows.h>
  7.  
  8. int RandomAction, Active, LoopDelay, HumanDelay,RandomDelay, RandomPixelsX, RandomPixelsY;
  9.  
  10.  
  11. class Action
  12. {
  13. public:
  14.  
  15. void Delay(int ms)
  16. {
  17. std::this_thread::sleep_for(std::chrono::milliseconds(ms));
  18. }
  19.  
  20. void KIP(int VirtualCode , int DwFlags)
  21. {
  22. Delay(HumanDelay);
  23. INPUT input;
  24. input.type = INPUT_KEYBOARD;
  25. input.ki.wScan = MapVirtualKey(VirtualCode , MAPVK_VK_TO_VSC);
  26. input.ki.time = NULL;
  27. input.ki.dwExtraInfo = NULL;
  28. input.ki.wVk = VirtualCode;
  29. input.ki.dwFlags = DwFlags;
  30. SendInput(1, &input, sizeof(INPUT));
  31. }
  32.  
  33. void MIP(int x , int y , int DwFlags)
  34. {
  35. Delay(HumanDelay);
  36. INPUT input;
  37. input.type = INPUT_MOUSE;
  38. input.mi.dx = x;
  39. input.mi.dy = y;
  40. input.mi.mouseData = NULL;
  41. input.mi.dwFlags = DwFlags;
  42. input.mi.time = NULL;
  43. input.mi.dwExtraInfo = NULL;
  44. SendInput(1, &input, sizeof(INPUT));
  45. }
  46. };
  47.  
  48.  
  49. int Random(int Min ,int Max)
  50. {
  51. int Result = rand() % Max + Min;
  52. return Result;
  53. }
  54.  
  55. void ActiveCheck()
  56. {
  57. if (GetAsyncKeyState(0x77))
  58. {
  59. Active = false;
  60. }
  61. }
  62.  
  63. void InputAction(int UseKeyInput, int UseMouseInput , int VirtualCode, int MouseDwFlags , int MouseDwFlags2, int UseDelayBetweenKeyInput, int UseDelayBetweenMouseInput)
  64. {
  65. Action t1;
  66. std::cout << RandomAction << "\t Key:" << "\t " << VirtualCode << std::endl;
  67. if (UseKeyInput == 1)
  68. {
  69. t1.KIP(VirtualCode, NULL);
  70. }
  71. if (UseDelayBetweenKeyInput == 1)
  72. {
  73. t1.Delay(HumanDelay);
  74. }
  75. if (UseDelayBetweenKeyInput == 2)
  76. {
  77. t1.Delay(RandomDelay);
  78. }
  79. if (UseKeyInput == 1)
  80. {
  81. t1.KIP(VirtualCode, KEYEVENTF_KEYUP);
  82. }
  83. if (UseMouseInput == 1 || UseMouseInput == 2)
  84. {
  85. t1.MIP(RandomPixelsX, RandomPixelsY, MouseDwFlags);
  86. }
  87. if (UseDelayBetweenMouseInput == 1)
  88. {
  89. t1.Delay(HumanDelay);
  90. }
  91. if (UseDelayBetweenMouseInput == 2)
  92. {
  93. t1.Delay(RandomDelay);
  94. }
  95. if (UseMouseInput == 2)
  96. {
  97. t1.MIP(RandomPixelsX, RandomPixelsY, MouseDwFlags2);
  98. }
  99. }
  100.  
  101.  
  102.  
  103. int main()
  104. {
  105. while (true)
  106. {
  107. Action Delay;
  108. Delay.Delay(1);
  109. while (true)
  110. {
  111. Delay.Delay(100);
  112. srand(Random(1 , 100));
  113. while (GetAsyncKeyState(0x76))
  114. {
  115. ActiveCheck();
  116. Active = true;
  117. while (Active == true)
  118. {
  119. LoopDelay = Random(100, 200);
  120. Delay.Delay(LoopDelay);
  121. RandomAction = Random(1, 250);
  122. std::cout << "Delay: " << LoopDelay << std::endl;
  123. HumanDelay = Random( 110 , 250);
  124. RandomDelay = Random( 700 , 1200);
  125. RandomPixelsX = Random ( -750, 1400 );
  126. RandomPixelsY = Random( -300, 600 );
  127.  
  128. if (RandomAction <= 25)
  129. {
  130. InputAction(1, 1, 0x57, MOUSEEVENTF_MOVE, NULL, 2, 1); // 1
  131. }
  132. else if (RandomAction >= 26 && RandomAction <=50)
  133. {
  134. InputAction(1, 1, 0x44, MOUSEEVENTF_MOVE, NULL, 2, 1); // 2
  135. }
  136. else if (RandomAction >= 51 && RandomAction <= 75)
  137. {
  138. InputAction(1, 1, 0x20, MOUSEEVENTF_MOVE, NULL, 1, 1); // 3
  139. }
  140. else if (RandomAction >= 76 && RandomAction <= 100)
  141. {
  142. InputAction(1, 1, 0x57, MOUSEEVENTF_MOVE, NULL, 2, 1); // 4
  143. }
  144. else if (RandomAction >= 101 && RandomAction <= 125)
  145. {
  146. InputAction(1, 1, 0x53, MOUSEEVENTF_MOVE, NULL, 1, 1); // 5
  147. }
  148. else if (RandomAction >= 126 && RandomAction <= 135)
  149. {
  150. InputAction(1, 1, 0x51, MOUSEEVENTF_MOVE, NULL, 1, 1); // 6
  151. }
  152. else if (RandomAction >= 136 && RandomAction <= 150)
  153. {
  154. InputAction(1, 1, 0x51, MOUSEEVENTF_LEFTDOWN, MOUSEEVENTF_LEFTUP, 1, 2); // 7
  155. }
  156. else if (RandomAction >= 151 && RandomAction <= 175)
  157. {
  158. InputAction(1, 1, 0x41, MOUSEEVENTF_MOVE, NULL, 2, 1); // 8
  159. }
  160. else if (RandomAction >= 176 && RandomAction <= 200)
  161. {
  162. InputAction(1, 1, 0x11, MOUSEEVENTF_MOVE, NULL, 2, 1); // 9
  163. }
  164. else if (RandomAction >= 201 && RandomAction <= 250)
  165. {
  166. InputAction(1, 1, 0x57, MOUSEEVENTF_MOVE, NULL, 2, 1); // 10
  167. }
  168. if (GetAsyncKeyState(0x77))
  169. {
  170. Active = false;
  171. break;
  172. }
  173. }
  174. }
  175.  
  176. break;
  177. }
  178. }
  179. return 0;
  180. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement