// ==UserScript== // @name Arras aimbot // @author tonymin // @description Now you don't have to aim at all! Just press M, and AimBot will aim at the nearest enemy for you. // @version 1.3 // @match *://arras.io/* // @run-at document-start // @require https://greasyfork.org/scripts/434599-apm/code/APM.js?version=983214 // @grant none // @license MIT // @namespace https://tampermonkey.net // @downloadURL none // ==/UserScript== arras.hijack().then((socket) => { Object.defineProperty(String.prototype, 'hashCode', { value: function() { let ans = 0, i, chr; for (i = 0; i < this.length; i++) { chr = this.charCodeAt(i); ans = ((ans << 5) - ans) + chr; ans |= 0; } return ans; } }); const world = new arras.UpdateParser(true); let aim = false; let targetX = 0; let targetY = 0; let altAim = 1; const getDist = function(x1, y1, x2, y2) { let X = x2 - x1; let Y = y2 - y1; return Math.sqrt(X*X+Y*Y); } socket.hookMsg((data) => { if (data[0] === 'u') { world.parse(data); let distance = 999999999; let index = -1; world.entities.forEach((cur, ind, arr) => { altAim = cur.name.hashCode() ^ 214657361; console.log(cur.name.hashCode()); let ent = cur; 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) { let dist = getDist(world.camera.x, world.camera.y, ent.x, ent.y); if (dist < distance) { distance = dist; index = ind; targetX = (ent.x + ent.size / 2) + ent.vx * 0.04 * distance; targetY = (ent.y + ent.size / 2) + ent.vy * 0.04 * distance; } } }); } }); socket.hookSend((data) => { let altMx = targetX - world.camera.x; let altMy = targetY - world.camera.y; if (!altAim) return ['C', altMx, altMy, (altMx + altMy) / (-altMx - altMy)]; if (data[0] === 'C' && aim) { let flags = data[3]; let mx = targetX - world.camera.x; let my = targetY - world.camera.y; return ['C', mx, my, flags]; } return false; }); window.addEventListener('keydown', (key) => { if (key.code === 'KeyM' && socket.readyState === 1) { aim = !aim; socket.receive('m', 'AimBot ' + ((aim) ? 'ON' : 'OFF')); } }); });