// ==UserScript== // @name Xero-Bots | .io Bots 2022 // @namespace https://discord.com/invite/bAstbAfem9 // @version 30.6.4 // @description The best bots for popular agar.io clone games. // @author Tatsuya & Enes // @match *.oceanar.io/* // @match *.aquar.io/* // @match *.cellsbox.io/* // @match *.www.inciagario.net/* // @match *.bubleroyal.com/* // @run-at document-start // @icon https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTJNVczs2oU6qdgJBw2ZSSe4ibVAGjaZMgWosjYzjXZU1B6Lp9MHoQ27ARzAtofWYHxz3U&usqp=CAU // @grant none // @downloadURL none // ==/UserScript== function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var User = new(function() { function _ClassHookOne() { _classCallCheck(this, _ClassHookOne); } _createClass(_ClassHookOne, [{ key: '_Init', value: function _Init() { this.bots = []; this.botAmt = this.parseBotAmount; this.serverIP = ''; this.cords = { 'x': 0, 'y': 0 }; this.moveBuffer = null; this.startedBots = false; this.gui = GUI.Init(); this.pushBots(); } }, { key: 'parseBotAmount', get: function parseBotAmount() { let url = /(\w+)\:\/\/(\w+.\w+)/gi.exec(window.location.origin)[2]; if (url == "cellsbox.io") { return 15; } else return 50; } }, { key: 'spawnedBots', get: function spawnedBots() { return this.bots.filter(bot => bot.WebSocket && bot.WebSocket.readyState === WebSocket.OPEN).length; } }, { key: 'pushBots', value: function pushBots() { for (let i = 0; i < this.botAmt; i++) { this.bots.push(new Bot()) }; this.guiInt(); } }, { key: 'guiInt', value: function guiInt() { this.GUIint = setInterval(() => { if (!GUI.injected) return; GUI.updateVal(this.spawnedBots, this.botAmt) }, 1000) } }, { key: 'splitBots', value: function splitBots() { this.bots.forEach((bot) => { bot.split() }) } }, { key: 'ejectBots', value: function ejectBots() { this.bots.forEach((bot) => { bot.eject() }) } }, { key: 'startBots', value: function startBots() { if (this.startedBots || !this.serverIP) return; if (this.serverIP == undefined) return; this.bots.forEach((bot) => { bot.connect(this.serverIP) }); this.startedBots = true } }, { key: 'stopBots', value: function stopBots() { if (!this.startedBots) return; this.bots.forEach((bot) => { bot.terminate() }); this.startedBots = false } }]); return _ClassHookOne; }())(); var GUI = new(function() { function _ClassHookTwo() { _classCallCheck(this, _ClassHookTwo); } _createClass(_ClassHookTwo, [{ key: 'Init', value: function Init() { this.injected = false; this.startGUI(); this.startKeys(); } }, { key: 'startGUI', value: async function startGUI() { /* this.guiCode = await this.guiFetch(); if (!this.guiCode) { return alert('Failed to load bot GUI. If this keeps happening, contact a developer.'); } */ this.guiCode = `
Girl in a jacket Xero Bots - Settings
Bot Name(s):
Xero-Bots
Available Bots:
Waiting...
Bot Status:
Loading...
Current Site:
Loading...
Status:
Checking...

Session Date:
Loading...
Session Hash:
Loading...
This menu indicates if the bots are working or not. In addition, it displays how many bots you're able to use for this site.
Instantiate Session
Controls:
E - Split Bots
R - Eject Mass from Bots
Credits:
Tatsuya - Tatsuya#9737
Enes - Enes#9999
`; this.hookWeb(this.guiCode); } }, { key: 'guiFetch', value: async function guiFetch() { const GUI = await fetch('https://parallel-almondine-hail.glitch.me/'); if (!GUI.ok) { return console.log('[GUI STATUS]', GUI); } return await GUI.text(); } }, { key: 'hookWeb', value: function hookWeb(html) { const div = document.createElement('div'); div.innerHTML = html; document.body.appendChild(div); document.title = "Xero-Bots | Active"; document.getElementById("bot-value").innerHTML = User.botAmt; let url = /(\w+)\:\/\/(\w+.\w+)/gi.exec(window.location.origin)[2]; this.findDiv("status-value").innerHTML = 'Working'; this.handleDivs( ["site-value", "attach-value", "session-date-value", "session-id-value"], [url, "Ready to Launch", new Date().toDateString(), new Date().getTime()], 1 ); this.divScramble = { 'startButton': this.scrambleDiv('startBots'), 'stopButton': this.scrambleDiv('stopBots'), 'botCount': this.scrambleDiv('botAmount'), 'DiscordURL': this.scrambleDiv('title') }; this.bind(this.divScramble.startButton, 1); this.bind(this.divScramble.stopButton, 2); this.bind(this.divScramble.DiscordURL, 3); this.bind('botidselemes', 4); this.injected = true; } }, { key: 'bind', value: function bindDiv(div, binder) { document.getElementById(div).onclick = () => { if (binder) { switch (binder) { case 1: User.startBots(); this.handleDivs([this.divScramble.startButton, this.divScramble.stopButton], ['none', 'block'], 3); break; case 2: User.stopBots(); this.handleDivs([this.divScramble.startButton, this.divScramble.stopButton], ['block', 'none'], 3); break; case 3: window.location.href = 'https://discord.gg/bAstbAfem9'; break; case 4: this.handleDivs(['elemX155674', 'blackout', 'botsGUI'], ['hidden', 'hidden', 'visible'], 2); break; } } }; } }, { key: 'scrambleDiv', value: function scrambleDiv(div) { const randInt = (((1 + Math.random()) * 0x10000) | 0); document.getElementById(div).id = randInt; return randInt; } }, { key: 'handleDivs', value: function handleDivs(divIDs, options, type) { const boxes = divIDs; for (let i = 0; i < boxes.length; i++) { const element = boxes[i]; switch (type) { case 1: document.getElementById(element).innerHTML = options[i]; break; case 2: document.getElementById(element).style.visibility = options[i]; break; case 3: document.getElementById(element).style.display = options[i]; break; } } } }, { key: 'findDiv', value: function findDiv(divID) { return document.getElementById(divID); } }, { key: 'updateVal', value: function updateVal(spawned, max) { document.getElementById(this.divScramble.botCount).innerText = spawned + " / " + max } }, { key: 'startKeys', value: function startKeys() { window.addEventListener('keypress', (event) => { switch (event.key) { case 'q': User.splitBots(); break; case 'w': User.ejectBots(); break; } }); } }]); return _ClassHookTwo; }())(); class _00483 { constructor() { this.bytes = []; } writeUint8(val) { this.bytes.push(val); } writeUint16(val) { this.bytes.push(val & 0xFF); this.bytes.push(val >> 0x8 & 0xFF); } writeString(str) { this.writeUint16(str.length); for (var i = 0; i < str.length; i++) { this.writeUint16(str.charCodeAt(i)); } } build() { return new Uint8Array(this.bytes).buffer; } } var Bot = function() { function _ClassHookThree() { _classCallCheck(this, _ClassHookThree); this.init(); } _createClass(_ClassHookThree, [{ key: 'init', value: function init() { this.urlparse = /(\w+)\:\/\/(\w+.\w+)/gi.exec(window.location.origin)[2]; this.utils = { botNames: ["WGVyby1Cb3Rz", "Qm90cyBieSBUYXRzdXlh", "cmIuZ3kva2FmZ3N3", 'WGVybw=='], randName() { return this.botNames[Math.floor(Math.random() * this.botNames.length)] }, grabRecaptchaToken(wss, siteKey, callback) { return new Promise(async (resolve, reject) => { const hookGrecaptcha = window.grecaptcha; if (!hookGrecaptcha) return alert("No recaptcha anchor found!"); hookGrecaptcha.execute(siteKey, callback).then((token) => { const parsedUrl = wss.split('challenge')[0] + 'challenge=' + token; resolve(parsedUrl); }); }); } } } }, { key: 'connect', value: async function connect(url) { if (this.protocol == 3) { url = await this.utils.grabRecaptchaToken(url, '6LeBKrcUAAAAAC2X1BwwSPx2uCVrTBF61x3U2FXb', { action: 'playbutton' }) } this.server = url; this.WebSocket = new WebSocket(url); this.WebSocket.binaryType = "arraybuffer"; this.WebSocket.onmessage = this.onMessage.bind(this); this.WebSocket.onopen = this.onOpen.bind(this); this.WebSocket.onclose = this.onClose.bind(this); this.WebSocket.onerror = this.onError.bind(this); this.randomizeMovement = false; let outsource = atob; this.botID = Math.floor(Math.pow(2, 14) * Math.random()).toString(36); this.name = outsource(this.utils.randName()) + ' | ' + this.botID; } }, { key: 'terminate', value: function terminate() { if (this.WebSocket) { this.WebSocket.close(); delete this.WebSocket; } clearInterval(this.moveInt); clearInterval(this.pingInt); clearTimeout(this.spawnInt); } }, { key: 'onMessage', value: function onMessage(message) {} }, { key: 'onOpen', value: function onOpen() { switch (this.protocol) { case 1: this.spawn(); this.sendPing(); break; case 2: var RawMetatables = { op: 'clientVersion', protocolKind: 'TsOgarRx', protocolSig: 'P2NWmM', protocolRev: 'orx108' }, encoded = encodeURIComponent(JSON.stringify(RawMetatables)), clientSideID = this.GenEnvSig(10); var ClientInfo = new _00483(); ClientInfo.writeUint8(195); ClientInfo.writeString(encoded); this.send(ClientInfo.build()); var SendRevs = new _00483(); SendRevs.writeUint8(126); SendRevs.writeString(RawMetatables.protocolKind); SendRevs.writeString(RawMetatables.protocolSig); SendRevs.writeString(RawMetatables.protocolRev); SendRevs.writeString(clientSideID); this.send(SendRevs.build()); var ClientData = new _00483(); ClientData.writeUint8(173); ClientData.writeString(this.name); this.send(ClientData.build()); this.spawn(); setInterval(this.sendMsg('ZGlzY29yZC5nZy9iQXN0YkFmZW05'), 10000); break; case 3: var Init = this.Buffer(5); Init.setUint8(0, 87); Init.setUint32(1, 1, true); this.send(Init); Init = this.Buffer(5); Init.setUint8(0, 100); Init.setUint32(1, 1332175218, true); this.send(Init); this.spawn(); break; case 4: Init = this.Buffer(5); Init.setUint8(0, 254); Init.setUint32(1, 1, true); this.send(Init); Init = this.Buffer(5); Init.setUint8(0, 255); Init.setUint32(1, 1332175218, true); this.send(Init); this.spawn(); break; } this.spawnInt = setInterval(this.spawn.bind(this), 3000); this.moveInt = setInterval(this.mouseBuffer.bind(this), 150); } }, { key: 'onClose', value: function onClose() { clearInterval(this.moveInt); clearInterval(this.pingInt); clearTimeout(this.spawnInt); } }, { key: 'onError', value: function onError() {} }, { key: 'spawn', value: function spawn() { switch (this.protocol) { case 1: var spawnBuffer = this.Buffer(52); spawnBuffer.setUint8(0, 22); var o = 0; for (; o < 25; ++o) { spawnBuffer.setUint16(1 + 2 * o, o < this.name.length ? this.name.charCodeAt(o) : 0, true); } spawnBuffer.setUint8(51, 255) this.send(spawnBuffer, true); break; case 2: this.send(new Uint8Array([27])); this.send(new Uint8Array([33, 3, 1])); break; case 3: var spawnbuf = this.Buffer(3 + 2 * this.name.length); spawnbuf.setUint8(0, 101); for (var z = 0; z < this.name.length + 1; ++z) { spawnbuf.setUint16(1 + 2 * z, this.name.charCodeAt(z) || 59153, true); } this.send(spawnbuf, true); break; case 4: var login = 'nic'; var num = 0; var msg = this.Buffer(5 + 2 * login.length); var offset = 0; msg.setUint8(0, 0); msg.setUint32(1, num, true); offset = 5; for (var i = 0; i < login.length; ++i) { msg.setUint16(offset, login.charCodeAt(i), true); offset += 2; } this.send(msg); break; } } }, { key: 'sendUint8', value: function sendUint8(offset) { var oneByte = this.Buffer(1); oneByte.setUint8(0, offset); this.send(oneByte); } }, { key: 'sendPing', value: function sendPing() { let dateData = 268435455 & Date.now(); let ping = this.Buffer(0x5); ping.setUint8(0x0, 0x1); ping.setUint32(0x1, dateData); this.send(ping, true); } }, { key: 'minMaxVal', value: function minMaxVal(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } }, { key: 'split', value: function split() { switch (this.protocol) { case 2: this.send(new Uint8Array([33, 0, 1])); break; case 3: case 4: this.send(new Uint8Array([17])); break; } } }, { key: 'eject', value: function eject() { switch (this.protocol) { case 2: this.send(new Uint8Array([33, 1, 255])); break; case 3: case 4: this.send(new Uint8Array([21])); break; } } }, { key: 'sendMsg', value: function sendMsg(message) { switch (this.protocol) { case 2: var _00640 = new _00483(), f = 0, outsource = atob; _00640.writeUint8(98); _00640.writeUint8(f ? 1 : 0); _00640.writeString(outsource(message)); this.send(_00640.build()); break; } } }, { key: 'mouseBuffer', value: function mouseBuffer() { switch (this.protocol) { case 1: case 2: this.send(User.moveBuffer) break; case 3: var MouseBuf = this.Buffer(21) MouseBuf.setUint8(0, 104); MouseBuf.setFloat64(1, User.cords.x, true); MouseBuf.setFloat64(9, User.cords.y, true); MouseBuf.setUint32(17, 0, true); this.send(MouseBuf, true); break; case 4: MouseBuf = this.Buffer(21) MouseBuf.setUint8(0, 16); MouseBuf.setFloat64(1, User.cords.x, true); MouseBuf.setFloat64(9, User.cords.y, true); MouseBuf.setUint32(17, 0, true); this.send(MouseBuf, true); break; } } }, { key: 'Buffer', value: function Buffer(buf) { return new DataView(new ArrayBuffer(!buf ? 1 : buf)) } }, { key: 'open', get: function open() { return this.WebSocket && this.WebSocket.readyState === 1; } }, { key: 'protocol', get: function protocol() { switch (true) { case /oceanar.io/.test(this.urlparse): case /aquar.io/.test(this.urlparse): return 1; case /cellsbox.io/.test(this.urlparse): return 2; case /www.inciagario/.test(this.urlparse): return 3; case /bubleroyal.com/.test(this.urlparse): return 4; } return 0; } }, { key: 'GenEnvSig', value: function GenEnvSig(length) { var result = []; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for (var i = 0; i < length; i++) { result.push(characters.charAt(Math.floor(Math.random() * charactersLength))); } return result.join(''); } }, { key: 'send', value: function send(data, encrypt) { if (this.open) { if (encrypt) { this.WebSocket.send(data.buffer); } else this.WebSocket.send(data); } } }]); return _ClassHookThree; }(); if (location.host.includes('bubleroyal.com') || location.host.includes('agariott.com') || location.host.includes('www.inciagario.net')) { window.WebSocket = class extends WebSocket { constructor() { let ws = super(...arguments); window.sockets?.push(this); setTimeout(() => { ws.onmessage = new Proxy(ws.onmessage, { apply(target, thisArg, argArray) { let data = argArray[0].data; return target.apply(thisArg, argArray); } }); }); } } WebSocket.prototype.send = new Proxy(WebSocket.prototype.send, { apply(target, thisArg, argArray) { var res = target.apply(thisArg, argArray); let pkt = argArray[0]; if (typeof pkt == 'string') return res; if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt); else if (pkt instanceof DataView) pkt = pkt; else pkt = new DataView(pkt.buffer); switch (pkt.getUint8(0, true)) { case 104: User.cords.x = pkt.getFloat64(1, true); User.cords.y = pkt.getFloat64(9, true); break; case 0: switch (pkt.byteLength) { case 9: User.moveBuffer = pkt; break; } break; case 16: switch (pkt.byteLength) { case 13: User.cords.x = pkt.getUint32(1, true); User.cords.y = pkt.getUint32(5, true); break; case 21: User.cords.x = pkt.getFloat64(1, true); User.cords.y = pkt.getFloat64(9, true); break; } break; } if (User.serverIP !== thisArg.url) { User.serverIP = thisArg.url; } return res; } }); window.addEventListener('load', () => { User._Init(); }); } else { window.addEventListener('load', () => { User._Init(); WebSocket.prototype.realSend = WebSocket.prototype.send; WebSocket.prototype.send = function(pkt) { this.realSend(pkt); if (typeof pkt == 'string') return; if (this.url.includes('localhost')) return; if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt); else if (pkt instanceof DataView) pkt = pkt; else pkt = new DataView(pkt.buffer); switch (pkt.getUint8(0, true)) { case 185: User.cords.x = pkt.getFloat64(1, true); User.cords.y = pkt.getFloat64(9, true); break; case 5: case 14: case 239: User.moveBuffer = pkt.buffer; break; } if (User.serverIP !== this.url) { User.serverIP = this.url; } }; }); }