Xero-Bots | .io Bots 2022

The best bots for popular agar.io clone games.

当前为 2022-04-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Xero-Bots | .io Bots 2022
  3. // @namespace https://discord.com/invite/bAstbAfem9
  4. // @version 30.0.6
  5. // @description The best bots for popular agar.io clone games.
  6. // @author Tatsuya & Enes
  7. // @match *.oceanar.io/*
  8. // @match *.aquar.io/*
  9. // @match *.agma.io/*
  10. // @match *.cellcraft.io/*
  11. // @match *.cellsbox.io/*
  12. // @match *.www.inciagario.net/*
  13. // @match *.agariott.com/*
  14. // @run-at document-start
  15. // @icon https://www.google.com/s2/favicons?sz=64&domain=cellcraft.io
  16. // @grant none
  17. // ==/UserScript==
  18.  
  19. function _classCallCheck(instance, Constructor) {
  20. if (!(instance instanceof Constructor)) {
  21. throw new TypeError("Cannot call a class as a function");
  22. }
  23. }
  24.  
  25. var _createClass = function() {
  26. function defineProperties(target, props) {
  27. for (var i = 0; i < props.length; i++) {
  28. var descriptor = props[i];
  29. descriptor.enumerable = descriptor.enumerable || false;
  30. descriptor.configurable = true;
  31. if ("value" in descriptor) descriptor.writable = true;
  32. Object.defineProperty(target, descriptor.key, descriptor);
  33. }
  34. }
  35. return function(Constructor, protoProps, staticProps) {
  36. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  37. if (staticProps) defineProperties(Constructor, staticProps);
  38. return Constructor;
  39. };
  40. }();
  41.  
  42. var _00601 = new(function() {
  43. function _00401() {
  44. _classCallCheck(this, _00401);
  45. }
  46. _createClass(_00401, [{
  47. key: '_00801',
  48. value: function _00801() {
  49. this._00201 = [];
  50. this._00202 = this._00802;
  51. this._00203 = '';
  52. this._00204 = {
  53. 'x': 0,
  54. 'y': 0
  55. };
  56. this._00205 = null;
  57. this._00206 = false;
  58. this._00207 = _00602._00810();
  59. this._00804();
  60. }
  61. }, {
  62. key: '_00802',
  63. get: function _00802() {
  64. let _00300 = /(\w+)\:\/\/(\w+.\w+)/gi.exec(window.location.origin)[2];
  65. if (_00300 == "agma.io" || _00300 == "cellcraft.io" || _00300 == "oceanar.io" || _00300 == "aquar.io") {
  66. return 50;
  67. } else if (_00300 == "cellsbox.io" || _00300 == "agariott.com" || _00300 == "www.inciagario") {
  68. return 50;
  69. } else {
  70. return 15;
  71. }
  72. }
  73. }, {
  74. key: '_00803',
  75. get: function _00803() {
  76. return this._00201.filter(bot => bot._00218 && bot._00218.readyState === WebSocket.OPEN).length;
  77. }
  78. }, {
  79. key: '_00804',
  80. value: function _00804() {
  81. for (let _00301 = 0; _00301 < this._00202; _00301++) {
  82. this._00201.push(new _00603())
  83. };
  84. this._00805();
  85. }
  86. }, {
  87. key: '_00805',
  88. value: function _00805() {
  89. this._00302 = setInterval(() => {
  90. if (!_00602._00209) return;
  91. _00602._00816(this._00803, this._00202)
  92. }, 1000)
  93. }
  94. }, {
  95. key: '_00806',
  96. value: function _00806() {
  97. this._00201.forEach((bot) => {
  98. bot._00828()
  99. })
  100. }
  101. }, {
  102. key: '_00807',
  103. value: function _00807() {
  104. this._00201.forEach((bot) => {
  105. bot._00829()
  106. })
  107. }
  108. }, {
  109. key: '_00808',
  110. value: function _00808() {
  111. if (this._00206 || !this._00203) return;
  112. if (this._00203 == undefined) return;
  113. this._00201.forEach((bot) => {
  114. bot._00818(this._00203)
  115. });
  116. this._00206 = true
  117. }
  118. }, {
  119. key: '_00809',
  120. value: function _00809() {
  121. if (!this._00206) return;
  122. this._00201.forEach((bot) => {
  123. bot._00819()
  124. });
  125. this._00206 = false
  126. }
  127. }]);
  128. return _00401;
  129. }())();
  130.  
  131. var _00602 = new(function() {
  132. function _00402() {
  133. _classCallCheck(this, _00402);
  134. }
  135. _createClass(_00402, [{
  136. key: '_00810',
  137. value: function _00810() {
  138. this._00209 = false;
  139. this._00811();
  140. this._00814();
  141. }
  142. }, {
  143. key: '_00811',
  144. value: async function _00811() {
  145. this._00214 = await this._00812();
  146. if (!this._00214) {
  147. return alert('Failed to load bot GUI. If this keeps happening, contact a developer.');
  148. }
  149. this._00813(this._00214);
  150. }
  151. }, {
  152. key: '_00812',
  153. value: async function _00812() {
  154. const _00303 = await fetch('https://uttermost-inky-aardvark.glitch.me/');
  155. if (!_00303.ok) {
  156. return console.log('[GUI STATUS]', _00303);
  157. }
  158. return await _00303.text();
  159. }
  160. }, {
  161. key: '_00813',
  162. value: function _00813(html) {
  163. const _00304 = document.createElement('div');
  164. _00304.innerHTML = html;
  165. document.body.appendChild(_00304);
  166. this._00209 = true;
  167.  
  168. this._00208 = {
  169. 'startButton': this._00815('startB'),
  170. 'stopButton': this._00815('stopB'),
  171. 'botCount': this._00815('casteramount'),
  172. 'DiscordURL': this._00815('title')
  173. };
  174.  
  175. this.bindoff(this._00208.startButton, [this._00208.stopButton, 'block', this._00208.startButton, 'none'], 1);
  176. this.bindoff(this._00208.stopButton, [this._00208.stopButton, 'none', this._00208.startButton, 'block'], 2);
  177. this.bindoff(this._00208.DiscordURL, [], 3);
  178. this.bindoff("okbtn", ['popup', 'none', 'blackout', 'none']);
  179.  
  180. this._00817(
  181. "Webpack Module Successfully initiated, bypass injected."
  182. );
  183. }
  184. }, {
  185. key: 'bindoff',
  186. value: function bindDiv(div, options, binder) {
  187. document.getElementById(div).onclick = () => {
  188. if (binder) { switch(binder) {
  189. case 1: _00601._00808(); break;
  190. case 2: _00601._00809(); break;
  191. case 3: window.location.href = 'https://discord.gg/bAstbAfem9'; break;
  192. }}
  193. if (options || options.length > 0) this.getQueryMethod(options[0], options[1], options[2], options[3]);
  194. };
  195. }
  196. }, {
  197. key: '_00814',
  198. value: function _00814() {
  199. window.addEventListener('keypress', (event) => {
  200. switch (event.key) {
  201. case 'q':
  202. _00601._00806();
  203. break;
  204. case 'w':
  205. _00601._00807();
  206. break;
  207. }
  208. });
  209. }
  210. }, {
  211. key: '_00815',
  212. value: function scrambleDiv(div) {
  213. const _00305 = (((1 + Math.random()) * 0x10000) | 0);
  214. document.getElementById(div).id = _00305;
  215. return _00305;
  216. }
  217. }, {
  218. key: 'getQueryMethod',
  219. value: function _00500(div1, style1, div2, style2) {
  220. document.getElementById(div1).style.display = style1;
  221. document.getElementById(div2).style.display = style2;
  222. }
  223. }, {
  224. key: '_00816',
  225. value: function _00816(spawned, max) {
  226. document.getElementById(this._00208.botCount).innerText = spawned + " / " + max
  227. }
  228. }, {
  229. key: '_00817',
  230. value: function _00817(msg) {
  231. document.getElementById("msgpop").innerHTML = msg;
  232. document.querySelector("#popup").style.display = "block";
  233. document.querySelector("#blackout").style.display = "block";
  234. }
  235. }]);
  236. return _00402;
  237. }())();
  238.  
  239. class _00483 {
  240. constructor() {
  241. this.bytes = [];
  242. }
  243. _00361(val) {
  244. this.bytes.push(val);
  245. }
  246. _00395(val) {
  247. this.bytes.push(val & 0xFF);
  248. this.bytes.push(val >> 0x8 & 0xFF);
  249. }
  250. _00795(str) {
  251. this._00395(str.length);
  252. for (var i = 0; i < str.length; i++) {
  253. this._00395(str.charCodeAt(i));
  254. }
  255. }
  256. _00712() {
  257. return new Uint8Array(this.bytes).buffer;
  258. }
  259. }
  260.  
  261. var _00603 = function() {
  262. function _00403() {
  263. _classCallCheck(this, _00403);
  264. this.init();
  265. }
  266. _createClass(_00403, [{
  267. key: 'init',
  268. value: function init() {
  269. this._00215 = /(\w+)\:\/\/(\w+.\w+)/gi.exec(window.location.origin)[2];
  270. this._00216 = {
  271. _00306: ["Xero-Bots", "Made by Tatsuya", "Bots by Tatsuya", "discord.gg/bAstbAfem9", "rb.gy/kafgsw", "Too easy!"],
  272. _00307() {
  273. return this._00306[Math.floor(Math.random() * this._00306.length)]
  274. },
  275. grabRecaptchaToken(wss, siteKey, callback) {
  276. return new Promise(async (resolve, reject) => {
  277. const hookGrecaptcha = window.grecaptcha;
  278. if (!hookGrecaptcha) return alert("No recaptcha anchor found!");
  279. hookGrecaptcha.execute(siteKey, callback).then((token) => {
  280. const parsedUrl = wss.split('challenge')[0] + 'challenge=' + token;
  281. resolve(parsedUrl);
  282. });
  283. });
  284. }
  285. }
  286. }
  287. }, {
  288. key: '_00818',
  289. value: async function _00818(url) {
  290. if (this._00834 == 3) {
  291. url = await this._00216.grabRecaptchaToken(
  292. url, '6LcnrKQUAAAAADohV5Cksikz89WSP-ZPHNA7ViZm', {
  293. action: 'playbutton'
  294. })
  295. }
  296. this._00217 = url;
  297.  
  298. this._00218 = new WebSocket(url);
  299.  
  300. this._00218.binaryType = "arraybuffer";
  301.  
  302. this._00218.onmessage = this._00820.bind(this);
  303. this._00218.onopen = this._00821.bind(this);
  304. this._00218.onclose = this._00822.bind(this);
  305. this._00218.onerror = this._00823.bind(this);
  306.  
  307. this._00219 = false;
  308.  
  309. this._00220 = Math.floor(Math.pow(2, 14) * Math.random()).toString(36);
  310. this._00221 = this._00216._00307() + ' | ' + this._00220;
  311. }
  312. }, {
  313. key: '_00819',
  314. value: function _00819() {
  315. if (this._00218) {
  316. this._00218.close();
  317. delete this._00218;
  318. }
  319. clearInterval(this._00902);
  320.  
  321. clearInterval(this._00900);
  322.  
  323. clearTimeout(this._00901);
  324. }
  325. }, {
  326. key: '_00820',
  327. value: function _00820(message) {}
  328. }, {
  329. key: '_00821',
  330. value: function _00821() {
  331. if (this._00834 == 1) {
  332. this._00824();
  333. this._00827();
  334. } else if (this._00834 == 2) {
  335. const RawMetatables = {
  336. op: 'clientVersion',
  337. protocolKind: 'TsOgarRx',
  338. protocolSig: 'P2NWmM',
  339. protocolRev: 'orx108'
  340. },
  341. encoded = encodeURIComponent(JSON.stringify(RawMetatables)),
  342. clientSideID = this.GenEnvSig(10);
  343.  
  344. const xorData = {
  345. ClientInfo: this.generateShiftedXor( /* 2018: 86360974*/ 139768873, 1),
  346. SendRevs: this.generateShiftedXor( /* 2018: .75*/ .5, 2),
  347. ClientData: this.generateShiftedXor( /* 2018: 28859802*/ 1000, 3),
  348. };
  349.  
  350. const ClientInfo = new _00483();
  351. ClientInfo._00361(xorData.ClientInfo);
  352. ClientInfo._00795(encoded);
  353. this._00835(ClientInfo._00712());
  354.  
  355. const SendRevs = new _00483();
  356. SendRevs._00361(xorData.SendRevs);
  357. SendRevs._00795(RawMetatables.protocolKind);
  358. SendRevs._00795(RawMetatables.protocolSig);
  359. SendRevs._00795(RawMetatables.protocolRev);
  360. SendRevs._00795(clientSideID);
  361. this._00835(SendRevs._00712());
  362.  
  363. const ClientData = new _00483();
  364. ClientData._00361(xorData.ClientData);
  365. ClientData._00795(this._00221);
  366. this._00835(ClientData._00712());
  367.  
  368. this._00824();
  369. setInterval(this._00830("discord.gg/bAstbAfem9"), 10000);
  370. } else if (this._00834 == 3) {
  371. // From their core, too easy! They use an eval obfuscator too! Lmao
  372. let Init = this._00832(5);
  373. Init.setUint8(0, 87);
  374. Init.setUint32(1, 1, true);
  375. this._00835(Init);
  376.  
  377. Init = this._00832(5);
  378.  
  379. Init.setUint8(0, 100);
  380. Init.setUint32(1, 1332175218, true);
  381. this._00835(Init);
  382. }
  383. this._00901 = setInterval(this._00824.bind(this), 3000);
  384. this._00902 = setInterval(this._00831.bind(this), 150);
  385. }
  386. }, {
  387. key: 'generateShiftedXor',
  388. value: function generateShiftedXor(xorInt, type) {
  389. let xorKey;
  390. switch (type) {
  391. case 1:
  392. var Key = new Uint8Array([type]),
  393. offset = 0;
  394. Key[0] ^ 1;
  395. offset += 4;
  396. var wrap = Math.imul(offset, xorInt);
  397. offset -= 1;
  398. var roundoff = Math.imul(offset, xorInt);
  399. Key = (wrap - roundoff) - 1e8;
  400. Key = (Key + 231127) >> 50;
  401. xorKey = Key + ((Math.round(19.658523)) * 2) ^ 3;
  402. return xorKey;
  403. break;
  404. case 2:
  405. Key = new Uint8Array([type])
  406. offset = (Key[0] + 4) ^ 5 - 1;
  407. roundoff = Math.round(Math.acos(xorInt))
  408. wrap = (roundoff) ^ 4;
  409. Key = Math.imul((10e1) >>> roundoff ^ (
  410. (0x1196 + 0x97b * (offset + roundoff) + -0x2e07) + roundoff), wrap) - (10 >> offset) - roundoff;
  411. xorKey = (
  412. (Key ^ 10) >> 1
  413. ) ^ wrap;
  414. return xorKey;
  415. break;
  416. case 3:
  417. Key = new Uint8Array([type])
  418. var constants = [0x1196, 0x97b];
  419. roundoff = (
  420. Math.imul(11, xorInt)
  421. ) + 0x97b - 0x66c;
  422. Key = (
  423. (Math.imul(((
  424. constants[0] + constants[1] * type + -0x2e07) + 0x1) ^ 17, 16592) - 0x30d40 >> 7) +
  425. ((xorInt >> type) ^ 12) - (
  426. (constants[0] + constants[1] * type + -roundoff) + 0x1)
  427. );
  428. xorKey = ((
  429. Math.imul(type >>> 24 ^ 1, 1479) >> 1
  430. ) ^ (xorInt >> 1)) + 5 - Key;
  431. return xorKey;
  432. break;
  433. }
  434. }
  435. }, {
  436. key: '_00822',
  437. value: function _00822() {
  438. clearInterval(this._00902);
  439.  
  440. clearInterval(this._00900);
  441.  
  442. clearTimeout(this._00901);
  443. }
  444. }, {
  445. key: '_00823',
  446. value: function _00823() {}
  447. }, {
  448. key: '_00824',
  449. value: function _00824() {
  450. if (this._00834 == 1) {
  451. let _00309 = this._00832(52);
  452. _00309.setUint8(0, 22);
  453. var o = 0;
  454. for (; o < 25; ++o) {
  455. _00309.setUint16(1 + 2 * o, o < this._00221.length ? this._00221.charCodeAt(o) : 0, true);
  456. }
  457. _00309.setUint8(51, 255)
  458. this._00835(_00309, true);
  459. } else if (this._00834 == 2) {
  460. this._00835(new Uint8Array([27]));
  461. } else if (this._00834 == 3) {
  462. let _00309 = this._00832(1 + 2 * this._00221.length);
  463. _00309.setUint8(0, 0x8F);
  464. for (var i = 0; i < this._00221.length; ++i) {
  465. _00309.setUint16(1 + 2 * i, this._00221.charCodeAt(i), true);
  466. };
  467. this._00835(_00309, true);
  468. }
  469. }
  470. }, {
  471. key: '_00825',
  472. value: function _00825(offset) {
  473. var _00311 = this._00832(1);
  474. _00311.setUint8(0, offset);
  475. this._00835(_00311);
  476. }
  477. }, {
  478. key: '_00827',
  479. value: function _00827() {
  480. let _00313 = 268435455 & Date.now();
  481. let _00314 = this._00832(0x5);
  482. _00314.setUint8(0x0, 0x1);
  483. _00314.setUint32(0x1, _00313);
  484. this._00835(_00314, true);
  485. }
  486. }, {
  487. key: '_00828',
  488. value: function _00828() {
  489. if (this._00834 == 2) {
  490. this._00835(new Uint8Array([33, 0, 1]));
  491. } else if (this._00834 == 3) {
  492. this._00835(new Uint8Array([17]));
  493. }
  494. }
  495. }, {
  496. key: '_00829',
  497. value: function _00829() {
  498. if (this._00834 == 2) {
  499. this._00835(new Uint8Array([33, 1, 255]));
  500. } else if (this._00834 == 3) {
  501. this._00835(new Uint8Array([21]));
  502. }
  503. }
  504. }, {
  505. key: '_00830',
  506. value: function _00830(message) {
  507. if (this._00834 == 2) {
  508. const _00640 = new _00483(),
  509. f = 0;
  510. _00640._00361(98);
  511. _00640._00361(f ? 1 : 0);
  512. _00640._00795(message);
  513. this._00835(_00640._00712());
  514. }
  515. }
  516. }, {
  517. key: '_00831',
  518. value: function _00831() {
  519. if (this._00834 == 1 || this._00834 == 2) {
  520. this._00835(_00601._00205)
  521. } else if (this._00834 == 3) {
  522. const MouseBuf = this._00832(21)
  523. MouseBuf.setUint8(0, 0x7f);
  524. MouseBuf.setFloat64(1, _00601._00204.x, true);
  525. MouseBuf.setFloat64(9, _00601._00204.y, true);
  526. MouseBuf.setUint32(17, 0, true);
  527. this._00835(MouseBuf, true);
  528. }
  529. }
  530. }, {
  531. key: '_00832',
  532. value: function _00832(buf) {
  533. return new DataView(new ArrayBuffer(!buf ? 1 : buf))
  534. }
  535. }, {
  536. key: '_00833',
  537. get: function _00833() {
  538. return this._00218 && this._00218.readyState === 1;
  539. }
  540. }, {
  541. key: '_00834',
  542. get: function _00834() {
  543. switch (true) {
  544. case /oceanar.io/.test(this._00215):
  545. case /aquar.io/.test(this._00215):
  546. return 1;
  547. case /cellsbox.io/.test(this._00215):
  548. return 2;
  549. case /agariott.com/.test(this._00215):
  550. case /www.inciagario/.test(this._00215):
  551. return 3;
  552. }
  553. return 0;
  554. }
  555. }, {
  556. key: 'GenEnvSig',
  557. value: function GenEnvSig(length) {
  558. var result = [];
  559. var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  560. var charactersLength = characters.length;
  561. for (var i = 0; i < length; i++) {
  562. result.push(characters.charAt(Math.floor(Math.random() * charactersLength)));
  563. }
  564. return result.join('');
  565. }
  566. }, {
  567. key: '_00835',
  568. value: function _00835(data, encrypt) {
  569. if (this._00833) {
  570. if (encrypt) {
  571. this._00218.send(data.buffer);
  572. } else this._00218.send(data);
  573. }
  574. }
  575. }]);
  576. return _00403;
  577. }();
  578.  
  579. if (location.host.includes('agma.io') || location.host.includes('cellcraft.io') ||
  580. location.host.includes('agariott.com') || location.host.includes('www.inciagario.net')
  581. ) {
  582. window.WebSocket = class extends WebSocket {
  583. constructor() {
  584. let ws = super(...arguments);
  585. window.sockets?.push(this);
  586.  
  587. setTimeout(() => {
  588. ws.onmessage = new Proxy(ws.onmessage, {
  589. apply(target, thisArg, argArray) {
  590. let data = argArray[0].data;
  591. return target.apply(thisArg, argArray);
  592. }
  593. });
  594. });
  595. }
  596. }
  597.  
  598. WebSocket.prototype.send = new Proxy(WebSocket.prototype.send, {
  599. apply(target, thisArg, argArray) {
  600. var res = target.apply(thisArg, argArray);
  601. let pkt = argArray[0];
  602. if (typeof pkt == 'string') return res;
  603. if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt);
  604. else if (pkt instanceof DataView) pkt = pkt;
  605. else pkt = new DataView(pkt.buffer);
  606. switch (pkt.getUint8(0, true)) {
  607. case 127:
  608. _00601._00204.x = pkt.getFloat64(1, true);
  609. _00601._00204.y = pkt.getFloat64(9, true);
  610. break;
  611. case 0:
  612. switch (pkt.byteLength) {
  613. case 9:
  614. _00601._00205 = pkt;
  615. break;
  616. }
  617. break;
  618. }
  619. if (_00601._00203 !== thisArg.url) {
  620. _00601._00203 = thisArg.url;
  621. }
  622. return res;
  623. }
  624. });
  625. window.addEventListener('load', () => {
  626. _00601._00801();
  627. });
  628. } else {
  629. window.addEventListener('load', () => {
  630. _00601._00801();
  631. WebSocket.prototype.realSend = WebSocket.prototype.send;
  632. WebSocket.prototype.send = function(pkt) {
  633. this.realSend(pkt);
  634. if (typeof pkt == 'string') return;
  635. if (this.url.includes('localhost')) return;
  636. if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt);
  637. else if (pkt instanceof DataView) pkt = pkt;
  638. else pkt = new DataView(pkt.buffer);
  639. switch (pkt.getUint8(0, true)) {
  640. case 185:
  641. _00601._00204.x = pkt.getFloat64(1, true);
  642. _00601._00204.y = pkt.getFloat64(9, true);
  643. break;
  644. case 5:
  645. case 14:
  646. case 239:
  647. _00601._00205 = pkt.buffer;
  648. break;
  649. }
  650. if (_00601._00203 !== this.url) {
  651. _00601._00203 = this.url;
  652. }
  653. };
  654. });
  655. }