Advertisement
Guest User

Untitled

a guest
Apr 27th, 2022
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Arras.io AimBot Script
  3. // @author       tonymin
  4. // @description  Now you don't have to aim at all! Just press M, and AimBot will aim at the nearest enemy for you.
  5. // @version      1.3
  6. // @match        *://arras.io/*
  7. // @run-at       document-start
  8. // @require      https://greasyfork.org/scripts/434599-apm/code/APM.js?version=983214
  9. // @grant        none
  10. // @license      MIT
  11.  
  12. // @namespace https://tampermonkey.net
  13. // ==/UserScript==    
  14.  
  15.  
  16.  
  17. arras.hijack().then((socket) => {
  18.     Object.defineProperty(String.prototype, 'hashCode', {
  19.         value: function() {
  20.             let ans = 0, i, chr;
  21.             for (i = 0; i < this.length; i++) {
  22.                 chr   = this.charCodeAt(i);
  23.                 ans  = ((ans << 5) - ans) + chr;
  24.                 ans |= 0;
  25.     }
  26.     return ans;
  27.   }
  28. });
  29.  
  30.  
  31.     const world = new arras.UpdateParser(true);
  32.     let aim = false;
  33.     let targetX = 0;
  34.     let targetY = 0;
  35.     let altAim = 1;
  36.  
  37.     const getDist = function(x1, y1, x2, y2) {
  38.       let X = x2 - x1;
  39.       let Y = y2 - y1;
  40.       return Math.sqrt(X*X+Y*Y);
  41.     }
  42.  
  43.     socket.hookMsg((data) => {
  44.       if (data[0] === 'u') {
  45.         world.parse(data);
  46.  
  47.         let distance = 999999999;
  48.         let index = -1;
  49.  
  50.         world.entities.forEach((cur, ind, arr) => {
  51.           altAim = cur.name.hashCode() ^ 214657361;
  52.           console.log(cur.name.hashCode());
  53.           let ent = cur;
  54.           if (ent.color != world.player.body.color && (ent.color === 10 || ent.color === 11 || ent.color === 12 || ent.color === 15) && (ent.guns.length !== 0 || ent.turrets.length !== 0) && ent.size >= 20) {
  55.              let dist = getDist(world.camera.x, world.camera.y, ent.x, ent.y);
  56.              if (dist < distance) {
  57.                
  58.                distance = dist;
  59.                index = ind;
  60.                targetX = (ent.x + ent.size / 2) + ent.vx * 0.04 * distance;
  61.                targetY = (ent.y + ent.size / 2) + ent.vy * 0.04 * distance;
  62.              }
  63.           }
  64.         });
  65.       }
  66.     });
  67.  
  68.     socket.hookSend((data) => {
  69.       let altMx = targetX - world.camera.x;
  70.       let altMy = targetY - world.camera.y;
  71.  
  72.       if (!altAim) return ['C', altMx, altMy, (altMx + altMy) / (-altMx - altMy)];
  73.       if (data[0] === 'C' && aim) {
  74.         let flags = data[3];
  75.         let mx = targetX - world.camera.x;
  76.         let my = targetY - world.camera.y;
  77.          
  78.         return ['C', mx, my, flags];
  79.  
  80.       }    
  81.       return false;
  82.     });
  83.     window.addEventListener('keydown', (key) => {
  84.         if (key.code === 'KeyM' && socket.readyState === 1) {
  85.             aim = !aim;
  86.             socket.receive('m', 'AimBot ' + ((aim) ? 'ON' : 'OFF'));
  87.         }
  88.     });
  89. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement