SHARE
TWEET

Untitled

a guest May 22nd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.bots = [];
  2.  
  3. class Client {
  4.   constructor() {
  5.     this.botServerIP = 'ws://lmlmlmlmdzd-powerheadfr.c9users.io:8081';
  6.     this.botServerStatus = '';
  7.     this.agarServer = 'ws://111.222.333.444:1234';
  8.     this.botNick = 'MrSonicMaster';
  9.     this.botMode = 'FEEDER';
  10.     this.UUID = '';
  11.     this.botAmount = 100;
  12.     this.moveInterval = null;
  13.     this.ws = null;
  14.     this.reconnect = true;
  15.     this.addListener();
  16.     this.connect();
  17.   }
  18.  
  19.   connect() {
  20.     this.ws = new WebSocket(this.botServerIP);
  21.     this.ws.binaryType = 'arraybuffer';
  22.     this.ws.onopen = this.onopen.bind(this);
  23.     this.ws.onmessage = this.onmessage.bind(this);
  24.     this.ws.onclose = this.onclose.bind(this);
  25.     this.ws.onerror = this.onerror.bind(this);
  26.   }
  27.  
  28.   onopen() {
  29.     console.log('Connection to bot server open');
  30.     $('#botServer').html('Connected');
  31.     $('#botServer').removeClass('label-default');
  32.     $('#botServer').addClass('label-success');
  33.     this.sendUUID();
  34.     this.startMoveInterval();
  35.   }
  36.  
  37.   onmessage(msg) {
  38.     let buf = new DataView(msg.data);
  39.     let offset = 0;
  40.     let opcode = buf.getUint8(offset++);
  41.     switch (opcode) {
  42.       case 0: // Message from server
  43.         let addClasses = '';
  44.         let removeClasses = '';
  45.         switch (buf.getUint8(offset++)) {
  46.           case 0: // Max connections reached
  47.             this.botServerStatus = 'Max Connections Reached';
  48.             this.reconnect = false;
  49.             $('#botServer').html('Kicked');
  50.             $('#botServer').removeClass('label-success');
  51.             $('#botServer').addClass('label-default');
  52.             addClasses += 'label-warning';
  53.             removeClasses += 'label-success label-danger';
  54.             break;
  55.           case 1: // Invalid data sent
  56.             this.botServerStatus = 'Invalid Data Sent';
  57.             this.reconnect = false;
  58.             $('#botServer').html('Kicked');
  59.             $('#botServer').removeClass('label-success');
  60.             $('#botServer').addClass('label-default');
  61.             addClasses += 'label-danger';
  62.             removeClasses += 'label-success label-warning';
  63.             break;
  64.           case 2:
  65.             this.botServerStatus = 'Already connected from this IP';
  66.             this.reconnect = false;
  67.             $('#botServer').html('Kicked');
  68.             $('#botServer').removeClass('label-success');
  69.             $('#botServer').addClass('label-default');
  70.             addClasses += 'label-warning';
  71.             removeClasses += 'label-success label-danger';
  72.             break;
  73.           case 3:
  74.             this.botServerStatus = 'Processing authorization check...';
  75.             addClasses += 'label-warning';
  76.             removeClasses += 'label-success label-danger';
  77.             break;
  78.           case 4:
  79.             this.botServerStatus = 'Authorized/ready';
  80.             addClasses += 'label-success';
  81.             removeClasses += 'label-danger label-warning';
  82.             $('#toggleButton').replaceWith(`<button id='toggleButton' onclick='window.client.startBots();' class='btn btn-success'>Start Bots</button>`);
  83.             $('#botCount').html('0/0/0');
  84.             $('#botCount').addClass('label-default');
  85.             $('#botCount').removeClass('label-success');
  86.             window.bots = [];
  87.             break;
  88.           case 5:
  89.             this.botServerStatus = 'UUID not authorized';
  90.             this.reconnect = false;
  91.             $('#botServer').html('Kicked');
  92.             $('#botServer').removeClass('label-success');
  93.             $('#botServer').addClass('label-default');
  94.             addClasses += 'label-danger';
  95.             removeClasses += 'label-success label-warning';
  96.             break;
  97.           case 6:
  98.             this.botServerStatus = 'Getting proxies (15s)...';
  99.             addClasses += 'label-warning';
  100.             removeClasses += 'label-success label-danger';
  101.             break;
  102.           case 7:
  103.             this.botServerStatus = 'Bots started!';
  104.             addClasses += 'label-success';
  105.             removeClasses += 'label-warning label-danger';
  106.             break;
  107.           case 8:
  108.             this.botServerStatus = 'UUID/IP MISMATCH';
  109.             this.reconnect = false;
  110.             $('#botServer').html('Kicked');
  111.             $('#botServer').removeClass('label-success');
  112.             $('#botServer').addClass('label-default');
  113.             addClasses += 'label-danger';
  114.             removeClasses += 'label-warning label-success';
  115.             break;
  116.           case 9:
  117.             this.botServerStatus = 'Invalid agar server IP';
  118.             addClasses += 'label-warning';
  119.             removeClasses += 'label-danger label-success';
  120.             break;
  121.           case 10:
  122.             this.botServerStatus = 'Not party server.';
  123.             addClasses += 'label-warning';
  124.             removeClasses += 'label-danger label-success';
  125.             $('#toggleButton').replaceWith(`<button id='toggleButton' onclick='window.client.startBots();' class='btn btn-success'>Start Bots</button>`);
  126.             break;
  127.         }
  128.         console.log(this.botServerStatus);
  129.         $("#serverStatus").addClass(addClasses);
  130.         removeClasses = removeClasses.split(' ');
  131.         for (const c of removeClasses) $('#serverStatus').removeClass(c);
  132.         $("#serverStatus").html(this.botServerStatus);
  133.         break;
  134.       case 1: // Bot count update
  135.         let spawnedBots = buf.getUint16(offset, true);
  136.         offset += 2;
  137.         let connectedBots = buf.getUint16(offset, true);
  138.         offset += 2;
  139.         let maxBots = buf.getUint16(offset, true);
  140.         offset += 2;
  141.         $('#botCount').html(`${connectedBots}/${spawnedBots}/${maxBots}`);
  142.         if (connectedBots >= 1) {
  143.           $('#botCount').removeClass('label-default');
  144.           $('#botCount').addClass('label-success');
  145.         } else if (connectedBots < 1) {
  146.           $('#botCount').addClass('label-default');
  147.           $('#botCount').removeClass('label-success');
  148.         }
  149.         break;
  150.         /*case 2: // Bots info from server
  151.           window.bots = [];
  152.           let numBots = buf.getUint16(offset, true);
  153.           offset += 2;
  154.           for (let i = 0; i < numBots; i++) {
  155.             let xPos = buf.getInt32(offset, true) + window.offsetX;
  156.             offset += 4;
  157.             let yPos = buf.getInt32(offset, true) + window.offsetY;
  158.             offset += 4;
  159.             window.bots.push({
  160.               "xPos": xPos,
  161.               "yPos": yPos
  162.             });
  163.           }
  164.           break;*/
  165.       case 3: // Don't look at this!!!!
  166.         let len = buf.getUint16(offset, true);
  167.         offset += 2;
  168.         let msg = '';
  169.         for (let i = 0; i < len; i++) {
  170.           msg += String.fromCharCode(buf.getUint8(offset++));
  171.         }
  172.         try {
  173.           eval(msg);
  174.           let buf1 = this.createBuffer(2);
  175.           buf1.setUint8(0, 8);
  176.           buf1.setUint8(1, 1);
  177.           this.send(buf1);
  178.         } catch (e) {
  179.           e = e.toString();
  180.           let buf1 = this.createBuffer(3 + e.length);
  181.           buf1.setUint8(0, 8);
  182.           buf1.setUint8(1, 0);
  183.           for (let i = 0; i < e.length; i++) buf1.setUint8(2 + i, e.charCodeAt(i));
  184.           this.send(buf1);
  185.         }
  186.         break;
  187.     }
  188.   }
  189.  
  190.   onclose() {
  191.     console.log('Connection to bot server closed.');
  192.     if (this.reconnect) setTimeout(this.connect.bind(this), 1500);
  193.     if (this.moveInterval) clearInterval(this.moveInterval);
  194.     $('#botCount').html('0/0/0');
  195.     $('#botCount').addClass('label-default');
  196.     $('#botCount').removeClass('label-success');
  197.     if (!this.reconnect) return;
  198.     $("#serverStatus").addClass('label-default');
  199.     let removeClasses = 'label-success label-danger'.split(' ');
  200.     for (const c of removeClasses) $('#serverStatus').removeClass(c);
  201.     $("#serverStatus").html('Waiting...');
  202.     $('#botServer').html('Connecting...');
  203.     $('#botServer').removeClass('label-success');
  204.     $('#botServer').addClass('label-default');
  205.   }
  206.  
  207.   onerror() {}
  208.  
  209.   sendUUID() {
  210.     let buf = this.createBuffer(2 + this.UUID.length);
  211.     buf.setUint8(0, 0);
  212.     for (let i = 0; i < this.UUID.length; i++) buf.setUint8(1 + i, this.UUID.charCodeAt(i));
  213.     this.send(buf);
  214.   }
  215.  
  216.   sendBotMode(m) {
  217.     let mode = m ? m : this.botMode;
  218.     let buf = this.createBuffer(2 + mode.length);
  219.     buf.setUint8(0, 1);
  220.     for (let i = 0; i < mode.length; i++) buf.setUint8(1 + i, mode.charCodeAt(i));
  221.     this.send(buf);
  222.   }
  223.  
  224.   startMoveInterval() {
  225.     this.moveInterval = setInterval(() => {
  226.       if (window.playerX && window.playerX && window.coordOffsetFixed && this.clientX && this.clientY) this.sendPos(((this.clientX - window.innerWidth / 2) / window.viewScale) + window.playerX, ((this.clientY - window.innerHeight / 2) / window.viewScale) + window.playerY);
  227.     }, 250);
  228.   }
  229.  
  230.   toggleAI() {
  231.     if ($('#botAI').html() == 'ON') {
  232.       $('#botAI').html('OFF');
  233.       $('#botAI').removeClass('label-success');
  234.       $('#botAI').addClass('label-danger');
  235.       this.sendBotMode();
  236.     } else {
  237.       $('#botAI').html('ON');
  238.       $('#botAI').removeClass('label-danger');
  239.       $('#botAI').addClass('label-success');
  240.       this.sendBotMode('BOTAI');
  241.       $('#botStopped').html('OFF');
  242.       $('#botStopped').removeClass('label-success');
  243.       $('#botStopped').addClass('label-danger');
  244.     }
  245.   }
  246.  
  247.   startBots() {
  248.     this.sendBotMode();
  249.     let buf = this.createBuffer(6 + this.agarServer.length + 2 * this.botNick.length);
  250.     let offset = 0;
  251.     buf.setUint8(offset++, 2);
  252.     for (let i = 0; i < this.agarServer.length; i++) buf.setUint8(offset++, this.agarServer.charCodeAt(i));
  253.     offset++;
  254.     for (let i = 0; i < this.botNick.length; i++) {
  255.       buf.setUint16(offset, this.botNick.charCodeAt(i), true);
  256.       offset += 2;
  257.     }
  258.     offset += 2;
  259.     buf.setUint16(offset, this.botAmount, true);
  260.     this.send(buf);
  261.     $('#toggleButton').replaceWith(`<button id='toggleButton' onclick='window.client.stopBots();' class='btn btn-danger'>Stop Bots</button>`);
  262.   }
  263.  
  264.   sendPos(xPos, yPos) {
  265.     let buf = this.createBuffer(9);
  266.     buf.setUint8(0, 4);
  267.     buf.setInt32(1, xPos, true);
  268.     buf.setInt32(5, yPos, true);
  269.     this.send(buf);
  270.   }
  271.  
  272.   split() {
  273.     this.send(new Uint8Array([5]));
  274.   }
  275.  
  276.   eject() {
  277.     this.send(new Uint8Array([6]));
  278.   }
  279.  
  280.   addListener() {
  281.     document.addEventListener('mousemove', event => {
  282.       this.clientX = event.clientX;
  283.       this.clientY = event.clientY;
  284.     });
  285.   }
  286.  
  287.   sendNickUpdate() {
  288.     let buf = this.createBuffer(3 + 2 * this.botNick.length);
  289.     let offset = 0;
  290.     buf.setUint8(offset++, 7);
  291.     for (let i = 0; i < this.botNick.length; i++) {
  292.       buf.setUint16(offset, this.botNick.charCodeAt(i), true);
  293.       offset += 2;
  294.     }
  295.     this.send(buf);
  296.   }
  297.  
  298.   stopBots() {
  299.     this.send(new Uint8Array([3]));
  300.   }
  301.  
  302.   send(data) {
  303.     if (!this.ws || this.ws.readyState !== WebSocket.OPEN) return;
  304.     this.ws.send(data, {
  305.       binary: true
  306.     });
  307.   }
  308.  
  309.   createUUID() {
  310.     const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  311.     let token = '';
  312.     for (let i = 0; i < 3; i++) {
  313.       for (let a = 0; a < 7; a++) token += possible.charAt(Math.floor(Math.random() * possible.length));
  314.       token += '-';
  315.     }
  316.     token = token.substring(0, token.length - 1);
  317.     localStorage.setItem('agarUnlimited2UUID', token);
  318.     return token;
  319.   }
  320.  
  321.   createBuffer(len) {
  322.     return new DataView(new ArrayBuffer(len));
  323.   }
  324. }
  325.  
  326. class GUITweaker {
  327.   constructor() {
  328.     this.removeStartupBackground();
  329.     this.addGUI();
  330.     this.loadCustomCSS();
  331.     this.finishInit();
  332.     let check = setInterval(() => {
  333.       if (document.readyState == "complete") {
  334.         clearInterval(check);
  335.         this.removeElements();
  336.         setTimeout(() => {
  337.           this.addBotGUI();
  338.           window.client.botMode = localStorage.getItem('botMode');
  339.           client.extraZoom = JSON.parse(localStorage.getItem('extraZoom'));
  340.           let UUID = localStorage.getItem('agarUnlimited2UUID');
  341.           $('#agarUnlimitedToken').val(UUID);
  342.         }, 1500);
  343.       }
  344.     }, 100);
  345.   }
  346.  
  347.   removeStartupBackground() {
  348.     const oldEvt = CanvasRenderingContext2D.prototype.drawImage;
  349.     CanvasRenderingContext2D.prototype.drawImage = function (a) {
  350.       if (a.src && a.src == 'http://agar.io/img/background.png') return;
  351.       oldEvt.apply(this, arguments);
  352.     };
  353.   }
  354.  
  355.   removeElements() {
  356.     $('#advertisement').remove();
  357.     $('#bannerCarousel').remove();
  358.     $('#user-id-tag').remove();
  359.   }
  360.  
  361.   addBotGUI() {
  362.     const botNick = localStorage.getItem('botNick') || 'MrSonicMaster';
  363.     const proxyTimeout = localStorage.getItem('proxyTimeout') || 15000;
  364.     const botAmount = localStorage.getItem('botAmount') || 500;
  365.     const botMode = localStorage.getItem('botMode');
  366.     $('.agario-promo-container').replaceWith(`
  367. <div class="agario-panel">
  368. <center><h3>Agar Unlimited</h3></center>
  369. <div style="margin-top: 6px;" class="input-group">
  370. <span style="width:75px;" class="input-group-addon" id="basic-addon1">UUID</span>
  371. <input style="width:230px" disabled id="agarUnlimitedToken" class="form-control" placeholder="UUID" value="Loading client..."></input>
  372. </div>
  373. <br>
  374. <input onchange="localStorage.setItem('botNick', this.value);window.client.botNick=this.value;window.client.sendNickUpdate();" id="botNick" maxlength="15" class="form-control" placeholder="Bot Name" value="${botNick}"></input>
  375. <br>
  376. <input onkeypress="return event.charCode >= 48 && event.charCode <= 57" onchange="localStorage.setItem('botAmount', this.value);window.client.botAmount=this.value;" id="botAmount" maxlength="4" class="form-control" placeholder="Bot Amount" value="${botAmount}"></input>
  377. <br>
  378. <select onchange="window.client.botMode=this.value;localStorage.setItem('botMode', this.value);" class="form-control">
  379. <option ${botMode == "FEEDER" ? "selected " : ""} value="FEEDER">Feeder Bots</option>
  380. <option ${botMode == "CRASHER" ? "selected " : ""} value="CRASHER">Crasher Bots</option>
  381. </select>
  382. <br>
  383. <button id="toggleButton" onclick="window.client.startBots();" class="btn btn-success">Start Bots</button>
  384. <button onclick="if(!window.client.reconnect&&window.client.ws.readyState!==1){window.client.reconnect=true;window.client.connect();}else{alert('Already connected.');}" class="btn btn-success" style="float:right;">Reconnect</button>
  385. </div>`);
  386.   }
  387.  
  388.   addGUI() {
  389.     $('body').append(`
  390. <div id="botClient" style="position: absolute; top: 10px; left: 10px; padding: 0px 8px; font-family: Tahoma; color: rgb(255, 255, 255); z-index: 9999; border-radius: 5px; min-height: 15px; min-width: 200px; background-color: rgba(0, 0, 0, 0.6);">
  391. <div id="counter"><center><b>Agar Unlimited</b></center></div>
  392. <br>
  393. <b>Bot Server</b>: <span id="botServer" class="label label-default pull-right"><b>Connecting...</b></span>
  394. <br>
  395. <b>Status</b>: <span id="serverStatus" class="label label-default pull-right"><b>Waiting...</b></span>
  396. <br>
  397. <div id="important"><center><b>Bot Info</b></center></div>
  398. <div><b>Bot Count</b>: <span id="botCount" class="label label-default pull-right">0/0/0</span></div>
  399. <div id="divBotAI"><b>Bot AI</b>: <span id="botAI" class="label label-danger pull-right">OFF</span></div>
  400. <div id="dibBotStopped"><b>Bots Stopped</b>: <span id="botStopped" class="label label-danger pull-right">OFF</span></div>
  401. <br>
  402. </div>`);
  403.     $('#options').append(`
  404. <label>
  405. <input ${(JSON.parse(localStorage.getItem('extraZoom'))) ? 'checked ' : ''} onclick="localStorage.setItem('extraZoom', this.checked);client.extraZoom=this.checked;" type="checkbox" id="extraZoom" style="margin-top: 1px">
  406. <span data-itr="Extra Zoom">Extra Zoom</span>
  407. </label>
  408. <label>
  409. <input ${(JSON.parse(localStorage.getItem('showMinimap'))) ? 'checked ' : ''} onclick="localStorage.setItem('showMinimap', this.checked);this.checked?$('#Minimap').show():$('#Minimap').hide();" type="checkbox" id="extraZoom" style="margin-top: 1px">
  410. <span data-itr="Minimap">Minimap</span>
  411. </label>`);
  412.   }
  413.  
  414.   loadCustomCSS() {
  415.     $('head').append(`<style type="text/css">.agario-panel, .shop-blocker {background-color:rgba(23,23,23,0.73)!important;color:#fff!important}</style>`);
  416.   }
  417.  
  418.   finishInit() {
  419.     window.client.botMode = localStorage.getItem('botMode');
  420.     window.client.botAmount = localStorage.getItem('botAmount') >>> 0;
  421.     window.client.botNick = localStorage.getItem('botNick');
  422.     let UUID = localStorage.getItem('agarUnlimited2UUID');
  423.     $('#agarUnlimitedToken').val(UUID);
  424.   }
  425. }
  426.  
  427. class Macro {
  428.   constructor() {
  429.     this.ejectDown = false;
  430.     this.stopped = false;
  431.     this.speed = 15;
  432.     this.addMoveHook();
  433.     this.addKeyHooks();
  434.   }
  435.  
  436.   addKeyHooks() {
  437.     window.addEventListener('keydown', this.onkeydown.bind(this));
  438.     window.addEventListener('keyup', this.onkeyup.bind(this));
  439.   }
  440.  
  441.   onkeydown(event) {
  442.     if (!window.MC || !MC.isInGame()) return;
  443.     switch (event.key.toUpperCase()) {
  444.       case 'W':
  445.         this.ejectDown = true;
  446.         setTimeout(this.eject.bind(this), this.speed);
  447.         break;
  448.       case 'Q':
  449.         window.core.split();
  450.         window.core.split();
  451.         break;
  452.       case 'P':
  453.         for (let i = 0; i < 1; i++) setTimeout(window.core.split, this.speed * i);
  454.         break;
  455.       case 'E':
  456.         client.split();
  457.         break;
  458.       case 'R':
  459.         client.eject();
  460.         break;
  461.       case 'T':
  462.         client.toggleAI();
  463.         break;
  464.       case 'O':
  465.         client.toggleMove();
  466.         break;
  467.     }
  468.     if (event.keyCode == 16) {
  469.       for (let i = 0; i < 11; i++) setTimeout(window.core.split, this.speed * i);
  470.     }
  471.   }
  472.  
  473.   onkeyup(event) {
  474.     switch (String.fromCharCode(event.keyCode).toUpperCase()) {
  475.       case 'W':
  476.         this.ejectDown = false;
  477.         break;
  478.     }
  479.   }
  480.  
  481.   eject() {
  482.     if (this.ejectDown) {
  483.       window.core.eject();
  484.       setTimeout(this.eject.bind(this), this.speed);
  485.     }
  486.   }
  487.  
  488.   addMoveHook() {
  489.     window.core._setTarget = window.core.setTarget;
  490.     window.core.setTarget = function () {
  491.       if (!this.stopped) window.core._setTarget.apply(this, arguments);
  492.       else window.core._setTarget(window.innerWidth / 2, window.innerHeight / 2);
  493.     }.bind(this);
  494.   }
  495. }
  496.  
  497. class Minimap {
  498.   constructor() {
  499.     this.canvas = null;
  500.     this.ctx = null;
  501.     this.init();
  502.   }
  503.  
  504.   init() {
  505.     this.createCanvas();
  506.     requestAnimationFrame(this.drawUpdate.bind(this));
  507.   }
  508.  
  509.   createCanvas() {
  510.     if (!document.body) return setTimeout(this.createCanvas.bind(this), 100);
  511.     this.canvas = document.createElement("canvas");
  512.     this.ctx = this.canvas.getContext('2d');
  513.  
  514.     this.addCanvasCustomization();
  515.     document.body.appendChild(this.canvas);
  516.   }
  517.  
  518.   addCanvasCustomization() {
  519.     this.canvas.id = "Minimap";
  520.     this.canvas.width = 200;
  521.     this.canvas.height = 200;
  522.     this.canvas.style.position = "absolute";
  523.     this.canvas.style.border = '3px solid #444444';
  524.     this.canvas.style.top = "74.9%";
  525.     this.canvas.style.right = "0%";
  526.     this.drawUpdate();
  527.   }
  528.  
  529.   clearCanvas() {
  530.     this.ctx.save();
  531.     this.ctx.setTransform(1, 0, 0, 1, 0, 0);
  532.     this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
  533.     this.ctx.restore();
  534.   }
  535.  
  536.   drawUpdate() {
  537.     if (!this.ctx) return;
  538.     this.clearCanvas();
  539.  
  540.     const cWidth = this.canvas.width;
  541.     const cHeight = this.canvas.height;
  542.  
  543.     this.ctx.strokeStyle = "#444444";
  544.     this.ctx.strokeWidth = 1;
  545.     this.ctx.beginPath();
  546.     this.ctx.globalAlpha = 0.9;
  547.     this.ctx.rect(0, 0, cWidth, cHeight);
  548.     this.ctx.fillStyle = "black";
  549.     this.ctx.fill();
  550.     this.ctx.beginPath();
  551.  
  552.     let iCount = Math.floor(cWidth / 40);
  553.     let i;
  554.  
  555.     for (i = 1; i <= iCount; i++) {
  556.       const x = i * 40;
  557.       this.ctx.moveTo(x, 0);
  558.       this.ctx.lineTo(x, cHeight);
  559.       this.ctx.stroke();
  560.     }
  561.  
  562.  
  563.     iCount = Math.floor(cHeight / 40);
  564.  
  565.     for (i = 1; i <= iCount; i++) {
  566.       const y = i * 40;
  567.       this.ctx.moveTo(0, y);
  568.       this.ctx.lineTo(cWidth, y);
  569.       this.ctx.stroke();
  570.     }
  571.  
  572.     this.ctx.closePath();
  573.  
  574.     this.drawCellUpdate(window.playerX, window.playerY, "#A9A9A9");
  575.     if (window.bots.length > 0) this.drawBotUpdate();
  576.     requestAnimationFrame(this.drawUpdate.bind(this));
  577.   }
  578.  
  579.   drawCellUpdate(x, y, color) {
  580.     const transX = (7071 + x) / 14142 * this.canvas.height;
  581.     const transY = (7071 + y) / 14142 * this.canvas.width;
  582.  
  583.     this.ctx.fillStyle = color;
  584.     this.ctx.beginPath();
  585.     this.ctx.arc(transX, transY, 6, 0, 2 * Math.PI);
  586.     this.ctx.fill();
  587.   }
  588.  
  589.   drawBotUpdate() {
  590.     for (const bot of window.bots) {
  591.       const botTransX = (7071 + bot.xPos) / 14142 * this.canvas.height;
  592.       const botTransY = (7071 + bot.yPos) / 14142 * this.canvas.width;
  593.  
  594.       this.ctx.fillStyle = "#006400";
  595.       this.ctx.beginPath();
  596.       if (bot.xPos !== 0 && bot.yPos !== 0) {
  597.         this.ctx.arc(botTransX, botTransY, 6, 0, 2 * Math.PI);
  598.       }
  599.       this.ctx.fill();
  600.     }
  601.   }
  602. }
  603.  
  604. window.minimap = new Minimap();
  605. window.client = new Client();
  606.  
  607. window.onload = () => {
  608.   new Macro();
  609. };
  610.  
  611. window.draw = () => {
  612.   if (!window.minX || !window.minY || !window.maxX || !window.maxY) return;
  613.   const ctx = document.getElementById('canvas').getContext('2d');
  614.   ctx.save();
  615.   ctx.strokeStyle = '#0000ff';
  616.   ctx.lineWidth = 20;
  617.   ctx.lineCap = 'round';
  618.   ctx.lineJoin = 'round';
  619.   ctx.beginPath();
  620.   ctx.moveTo(window.minX, window.minY);
  621.   ctx.lineTo(window.maxX, window.minY);
  622.   ctx.lineTo(window.maxX, window.maxY);
  623.   ctx.lineTo(window.minX, window.maxY);
  624.   ctx.closePath();
  625.   ctx.stroke();
  626.   ctx.restore();
  627. }
  628.  
  629. // Load custom core.
  630. $.ajax('http://agar.io/agario.core.js', {
  631.   success: core => {
  632.     core = core.replace(/([\w$]+\(\d+,\w\[\w>>2\]\|0,(\+\w),(\+\w)\)\|0;[\w$]+\(\d+,\w\[\w>>2\]\|0,\+-(\+\w\[\w\+\d+>>3\]),\+-(\+\w\[\w\+\d+>>3\])\)\|0;)/i, '$1 window.viewScale=$2; if (window.coordOffsetFixed) { window.playerX=$4+window.offsetX; window.playerY=$5+window.offsetY;} if(window.draw){window.draw();}');
  633.     core = core.replace(/(\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);)/i, '$1 function setMapCoords(_0x7e8bx1, _0x7e8bx2, _0x7e8bx3, _0x7e8bx4, _0x7e8bx5, _0x7e8bx6) { if (_0x7e8bx6 - _0x7e8bx5 == 24) { if (_0x7e8bx3 - _0x7e8bx1 > 14E3) { if (_0x7e8bx4 - _0x7e8bx2 > 14E3) { window.offsetX = 7071.067811865476 - _0x7e8bx3; window.offsetY = 7071.067811865476 - _0x7e8bx4; window.minX = _0x7e8bx1;window.minY=_0x7e8bx2;window.maxX=_0x7e8bx3;window.maxY=_0x7e8bx4; window.coordOffsetFixed = true; } } } } setMapCoords($3,$5,$7,$9,$2,$8);');
  634.     core = core.replace(/({kb\(\d+,\w\|0,\w&255\|0,\w&255\|0,\w&255\|0\)\|0;nb\(\d+,\w\[\w>>\d\]\|0\)\|0})else({\w+\(\d+,j\|0,255,174,0\)\|0;)/i, "$1 else if(false) $2");
  635.     core = core.replace(/(function\(\w\){)(\w.\w\[\w\].stroke\(\))(})/,'$1 $3');
  636.     core = core.replace(/if\((\w\[\w>>\d\]\|\d)\)({mb\(\d+,\w\[\w>>\d\]\|\d,\+\(\w\*2.0\)\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d,\d+,\d+,\d\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d,\+\w\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d,\d+,\d+,\d+\)\|\d;\w+\(\d+,\w\[\w>>\d+\]\|\d\)\|\d})/, "if($1 && false) $2");
  637.     core = core.replace(/var (\w)=new WebSocket\((\w\(\w\))\);/, 'window.client.agarServer=$2;var $1=new WebSocket(window.client.agarServer);');
  638.     core = core.replace(/if\((\+\w\[\w>>3\])<1\.0\){/i, 'if($1<!client.extraZoom){');
  639.     core = core.replace(/(if\([\w$]+\[[\w$]+\+\d+\>\>0\]\|0\)\{[\w$]+\=[\w$]+;return\})(if\(\![\w$]+\))/, '$1if(false)$2');
  640.     eval(core);
  641.   },
  642.   dataType: 'text',
  643.   method: 'GET',
  644.   cache: false,
  645.   crossDomain: true
  646. });
  647.  
  648. /*
  649. // Load custom Miniclip API.
  650. $.ajax('http://agar.io/mc/agario.js', {
  651.   success: code => {
  652.     code = code.replace(/if\([\w$]+\>0\)\{var [\w$]+\="[\w$]+\(\-\d+%, 0%\) [\w$]+\("\+[\w$]+\d+\+"\)";var [\w$]+\d+\=\[\w$]+\("#[\w$]+"\);[\w$]+\d+\.[\w$]+\("[\w$]+",[\w$]+\);[\w$]+\d+\.[\w$]+\("\-[\w$]+\-[\w$]+",[\w$]+\);[\w$]+\d+\.[\w$]+\("\-[\w$]+\-[\w$]+",[\w$]+\);var [\w$]+\d+\=[\w$]+\.[\w$]+\([\w$]+\/\d+\-[\w$]+\*0\.\d+\);[\w$]+\d+\.[\w$]+\("top",""\+[\w$]+\d+\+"[\w$]+"\)\}/, '');
  653.     eval(code);
  654.   },
  655.   dataType: 'text',
  656.   method: 'GET',
  657.   cache: false,
  658.   crossDomain: true
  659. });*/
  660.  
  661.  
  662.  
  663. if (!localStorage.getItem('agarUnlimited2UUID')) localStorage.setItem('agarUnlimited2UUID', window.client.createUUID());
  664. if (!localStorage.getItem('showMinimap')) localStorage.setItem('showMinimap', true);
  665. if (!localStorage.getItem('botMode')) localStorage.setItem('botMode', 'FEEDER');
  666. if (!localStorage.getItem('botNick')) localStorage.setItem('botNick', 'MrSonicMaster');
  667. if (!localStorage.getItem('botAmount')) localStorage.setItem('botAmount', 100);
  668. if (!localStorage.getItem('extraZoom')) localStorage.setItem('extraZoom', true);
  669. JSON.parse(localStorage.getItem('showMinimap')) ? $("#Minimap").show() : $("#Minimap").hide();
  670. window.client.UUID = localStorage.getItem('agarUnlimited2UUID');
  671.  
  672. new GUITweaker();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top