// ==UserScript==
// @name Xero-Bots | .io Bots 2022
// @namespace https://discord.com/invite/bAstbAfem9
// @version 30.5
// @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 *.powerline.io/*
// @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 = `

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.
Controls:
E - Split Bots
R - Eject Mass from Bots
Credits:
Tatsuya - Tatsuya#9737
Enes - Enes#9999
Xero-Bots
0 / 0
`;
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];
if (url == 'powerline.io') {
this.findDiv("status-value").style.color = '#fbd326';
this.findDiv("status-value").innerHTML = 'Unstable';
} else {
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: 'startKeys',
value: function startKeys() {
window.addEventListener('keypress', (event) => {
switch (event.key) {
case 'q':
User.splitBots();
break;
case 'w':
User.ejectBots();
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
}
}]);
return _ClassHookTwo;
}())();
class _00483 {
constructor() {
this.bytes = [];
}
_00361(val) {
this.bytes.push(val);
}
_00395(val) {
this.bytes.push(val & 0xFF);
this.bytes.push(val >> 0x8 & 0xFF);
}
_00795(str) {
this._00395(str.length);
for (var i = 0; i < str.length; i++) {
this._00395(str.charCodeAt(i));
}
}
_00712() {
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._00361(195);
ClientInfo._00795(encoded);
this.send(ClientInfo._00712());
var SendRevs = new _00483();
SendRevs._00361(126);
SendRevs._00795(RawMetatables.protocolKind);
SendRevs._00795(RawMetatables.protocolSig);
SendRevs._00795(RawMetatables.protocolRev);
SendRevs._00795(clientSideID);
this.send(SendRevs._00712());
var ClientData = new _00483();
ClientData._00361(173);
ClientData._00795(this.name);
this.send(ClientData._00712());
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, 191);
Init.setUint16(1, (1000 / 10) * 1, !0);
Init.setUint16(3, (1000 / 10) * 1, !0);
this.send(Init);
this.sendUint8(0x0);
this.spawn();
this.spawnInt = setInterval(() => {
this.sendTalk(this.minMaxVal(0, 9));
this.sendTurnPoint()
}, 8000);
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) || 57344, true);
}
this.send(spawnbuf, true);
break;
case 4:
spawnbuf = this.Buffer(3 + 2 * this.name.length);
spawnbuf.setUint8(0, 3);
for (var f = 0; f < this.name.length; ++f) {
spawnbuf.setUint16(1 + 2 * f, this.name.charCodeAt(f), true);
}
this.send(spawnbuf);
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: 'sendTalk',
value: function sendTalk(num) {
let talk = this.Buffer(2);
talk.setUint8(0, 12);
talk.setUint8(1, num);
this.send(talk);
}
}, {
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: 'sendTurnPoint',
value: function sendTurnPoint(b) {
b = window.pbskids;
if (!b) return;
console.log(b);
var c = new ArrayBuffer(11),
g = new DataView(c),
f = 0;
g.setUint8(f, 6);
f += 1;
g.setUint8(f, 2, !0);
f += 1;
g.setFloat32(f, b, !0);
var h = 0;
g.setUint8(f + 4, 0, !0);
this.send(c)
}
}, {
key: 'split',
value: function split() {
switch (this.protocol) {
case 2:
this.send(new Uint8Array([33, 0, 1]));
break;
case 3:
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:
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._00361(98);
_00640._00361(f ? 1 : 0);
_00640._00795(outsource(message));
this.send(_00640._00712());
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;
}
}
}, {
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 /powerline.io/.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('agma.io') || location.host.includes('cellcraft.io') ||
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;
}
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;
}
};
});
}