Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. struct SCREEN_AIMBOT
  2. {
  3. #define SCREEN_INIT 0x10203040
  4. struct SCREEN_POINTS
  5. {
  6. float x;
  7. float y;
  8. };
  9.  
  10. SCREEN_POINTS points[0x100];
  11. int count;
  12. float screenw;
  13. float screenh;
  14. DWORD init;
  15.  
  16. void Init(float _screenw, float _screenh)
  17. {
  18.  
  19. if (init == SCREEN_INIT)return;
  20.  
  21. count = 0;
  22.  
  23. screenw = _screenw;
  24.  
  25. screenh = _screenh;
  26.  
  27. init = SCREEN_INIT;
  28.  
  29. }
  30.  
  31. void Add(float x, float y)
  32. {
  33.  
  34. if (init != SCREEN_INIT)return;
  35.  
  36. if (count >= 0x100)return;
  37.  
  38. points[count].x = x;
  39.  
  40. points[count].y = y;
  41.  
  42. count++;
  43.  
  44. };
  45.  
  46. void Free()
  47. {
  48.  
  49. if (init != SCREEN_INIT)return;
  50.  
  51. count = 0;
  52.  
  53. };
  54.  
  55. float Distance2D(float x1, float y1, float x2, float y2)
  56. {
  57.  
  58. return sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
  59.  
  60. }
  61.  
  62. void Go(float speed)
  63. {
  64.  
  65. if (init != SCREEN_INIT)return;
  66.  
  67. float mindist = 99999.0;
  68.  
  69. int index = -1;
  70.  
  71. for (int i = 0; i<count; i++)
  72. {
  73.  
  74.  
  75.  
  76.  
  77. float dist = Distance2D(screenw / 2, screenh / 2, points[i].x, points[i].y);
  78.  
  79. if (dist<mindist)
  80. {
  81.  
  82. mindist = dist;
  83.  
  84. index = i;
  85.  
  86. };
  87.  
  88. };
  89.  
  90.  
  91. if (index > -1)
  92. {
  93.  
  94. float dx = (points[index].x - screenw / 2)*speed;
  95.  
  96. float dy = (points[index].y - screenh / 2)*speed;
  97.  
  98. ::mouse_event(MOUSEEVENTF_MOVE, dx, dy, 0, 0);
  99.  
  100. }
  101. }
  102.  
  103.  
  104. } Aimbot;
  105.  
  106. bool LWA = 0;
  107. if ((aim_key && aimtarget == (ULONGLONG)Player) || !aimtarget)
  108. {
  109. if (aimtarget == (ULONGLONG)Player)LWA = 1;
  110. }
  111. else goto exit_aim;
  112.  
  113. float screenaim_w = aim_fov * 12;
  114. float screenaim_h = aim_fov * 12;
  115. float pos_x = w_h[0] - screenaim_w / 2;
  116. float pos_y = w_h[1] - screenaim_h / 2;
  117. float cx = BGUI::viewport.Width / 2;
  118. float cy = BGUI::viewport.Height / 2;
  119.  
  120. float dscreen = w_h[0] - BGUI::viewport.Width / 2;
  121.  
  122. if (aim_work)
  123. {
  124. if (LWA || cx > pos_x && cy > pos_y && cx < pos_x + screenaim_w && cy < pos_y + screenaim_h && !LWA)
  125. {
  126.  
  127. if (LWA || abs(dscreen) < abs(min_dscreen))// && aim_priority == 0) || ((dist < mindist) && aim_priority == 1) && !LWA)
  128. {
  129. min_dscreen = dscreen;
  130. aims_pos_x = w_h[0];
  131. aims_pos_y = w_h[1] + 10;
  132.  
  133. aimentity_adr = (ULONGLONG)Player;
  134. aim_update = true;
  135. }
  136. }
  137. }exit_aim:;
  138.  
  139. if (aim_work && aim_update)
  140. {
  141. if (GetAsyncKeyState(MENU::enterkey_aimkey.key))
  142. {
  143. Aimbot.Add(aims_pos_x, aims_pos_y);
  144. Aimbot.Init(BGUI::viewport.Width, BGUI::viewport.Height);
  145. Aimbot.Go(aim_speed);
  146. Aimbot.Free();
  147.  
  148. aimtarget = aimentity_adr;
  149. }
  150. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement