Greasy Fork is available in English.

Gats.io - Anti Aimbot

you can't use aimbot with this enabled

  1. // ==UserScript==
  2. // @name Gats.io - Anti Aimbot
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description you can't use aimbot with this enabled
  6. // @author nitrogem35
  7. // @match https://gats.io
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. console.log = console.dir; //Allows console.log to be used
  14. var mouseX;
  15. var mouseY;
  16. var mouseAngle2;
  17. var centerX = document.body.clientWidth/2;
  18. var centerY = document.body.clientHeight/2; //get height and width of screen
  19. var detections = 0;
  20. document.addEventListener('mousemove', function(event) { //get mouse coordinates and calculate the angle where your player should be facing
  21. mouseX = event.clientX;
  22. mouseY = event.clientY;
  23. mouseAngle2 = Math.floor((angle(centerX,centerY,mouseX,mouseY)+360)%360);
  24. });
  25. function angle(x1, y1, x2, y2) { //angle calculation function
  26. var angleRads = Math.atan2(y2 - y1, x2 - x1);
  27. var angleDegrees = angleRads * (180/Math.PI);
  28. return angleDegrees;
  29. }
  30. setInterval(function() { //check mouse angle relative to player angle
  31. if(Math.abs(RD.pool[c3].playerAngle - mouseAngle2) > 30) {
  32. console.log('aimbot detected...');
  33. detections++;
  34. }
  35. if(detections > 10) { //if aimbot is detected for more then 1s, close the connection
  36. RF.list[0].socket.close();
  37. }
  38. }, 100);
  39. setInterval(function() { //reset detetections every 4s to avoid accidental kick
  40. detections = 0;
  41. }, 4000);
  42. })();