Xero-Bots | .io Bots 2022

The best bots for popular agar.io clone games.

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

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