Gats.io Flick and Shoot Aimbot Script with E Key

Press E to flick, shoot, and aimbot in Gats.io

  1. // ==UserScript==
  2. // @name Gats.io Flick and Shoot Aimbot Script with E Key
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Press E to flick, shoot, and aimbot in Gats.io
  6. // @author Dark
  7. // @match *://gats.io/* // Adjust this to match the game URL exactly
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Variables for custom key bindings
  15. const flickKey = 0; // 0 is the left mouse button (flick action)
  16. const pistolKey = 'F'; // Key to shoot
  17. const actionKey = 'E'; // Key to trigger both flick and shoot
  18. const flickDuration = 50; // Duration of the flick in milliseconds
  19. let isFlicking = false; // State to track whether the flick action is in progress
  20.  
  21. // Function to simulate a key press event
  22. function simulateKeyPress(key) {
  23. const keydownEvent = new KeyboardEvent('keydown', {
  24. key: key,
  25. bubbles: true,
  26. cancelable: true
  27. });
  28. document.dispatchEvent(keydownEvent);
  29.  
  30. setTimeout(() => {
  31. const keyupEvent = new KeyboardEvent('keyup', {
  32. key: key,
  33. bubbles: true,
  34. cancelable: true
  35. });
  36. document.dispatchEvent(keyupEvent);
  37. }, 10); // Small delay to simulate a real key press
  38. }
  39.  
  40. // Function to simulate mouse click (flick action)
  41. function simulateMouseClick() {
  42. const mousedownEvent = new MouseEvent('mousedown', {
  43. button: flickKey,
  44. bubbles: true,
  45. cancelable: true
  46. });
  47. document.dispatchEvent(mousedownEvent);
  48.  
  49. setTimeout(() => {
  50. const mouseupEvent = new MouseEvent('mouseup', {
  51. button: flickKey,
  52. bubbles: true,
  53. cancelable: true
  54. });
  55. document.dispatchEvent(mouseupEvent);
  56. }, flickDuration);
  57. }
  58.  
  59. // Aimbot logic
  60. function aimbot() {
  61. const me = game.getMyPlayer();
  62. const enemies = game.getEnemies();
  63. if (enemies.length > 0) {
  64. const closestEnemy = enemies.reduce((closest, enemy) => {
  65. const dist = calc.distance(me, enemy);
  66. return dist < closest.dist ? { enemy, dist } : closest;
  67. }, { enemy: null, dist: Infinity });
  68.  
  69. if (closestEnemy.enemy) {
  70. const enemyVector = { x: closestEnemy.enemy.x - me.x, y: closestEnemy.enemy.y - me.y };
  71. const movementVector = calc.normalize(enemyVector, 1);
  72. const goal = calc.combine(me, movementVector);
  73.  
  74. if (!game.isOutsideMap(goal)) {
  75. // Simulate the mouse flick to aim at the enemy
  76. console.log(`Aimbot targeting enemy at: ${goal.x}, ${goal.y}`);
  77. GameInterface.conn.send(`move to ${goal.x}, ${goal.y}`);
  78. }
  79. }
  80. }
  81. }
  82.  
  83. // Event listener for pressing the actionKey (E)
  84. document.addEventListener('keydown', (event) => {
  85. if (event.key === actionKey && !isFlicking) {
  86. isFlicking = true;
  87.  
  88. // Activate aimbot during flick
  89. aimbot(); // Aim at the closest enemy
  90.  
  91. // Simulate flick (mouse click) and shoot (key F press)
  92. console.log('Action key pressed: Flick and shoot initiated');
  93.  
  94. // Simulate mouse click (flick action)
  95. simulateMouseClick();
  96.  
  97. // Simulate pistol shot after flick duration
  98. setTimeout(() => {
  99. simulateKeyPress(pistolKey);
  100. isFlicking = false; // Reset flick state
  101. }, flickDuration);
  102. }
  103. });
  104. })();