Xero-Bots | .io Bots 2022

The best bots for popular agar.io clone games.

当前为 2022-09-03 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Xero-Bots | .io Bots 2022
  3. // @namespace https://discord.com/invite/bAstbAfem9
  4. // @version 30.6.8
  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 *.cellsbox.io/*
  10. // @match *.www.inciagario.net/*
  11. // @match *.bubleroyal.com/*
  12. // @run-at document-start
  13. // @icon https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTJNVczs2oU6qdgJBw2ZSSe4ibVAGjaZMgWosjYzjXZU1B6Lp9MHoQ27ARzAtofWYHxz3U&usqp=CAU
  14. // @grant none
  15. // ==/UserScript==
  16.  
  17. var Xero_Protect_Class = function () {
  18. function defineProperties(target, props) {
  19. for (var i = 0; i < props.length; i++) {
  20. var descriptor = props[i];
  21. descriptor.enumerable = descriptor.enumerable || false;
  22. descriptor.configurable = true;
  23. if ("value" in descriptor) descriptor.writable = true;
  24. Object.defineProperty(target, descriptor.key, descriptor);
  25. }
  26. }
  27. return function (Constructor, protoProps, staticProps) {
  28. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  29. if (staticProps) defineProperties(Constructor, staticProps);
  30. return Constructor;
  31. };
  32. }();
  33.  
  34. function newcclosure(target, HookedArgs) {
  35. if (typeof target != 'function') return console.error("expected function as argument #1");
  36. if (HookedArgs) return console.error("expected one function as an argument");
  37.  
  38. return target;
  39. }
  40.  
  41. function create_secure_function(args, unexpected) {
  42. return newcclosure(args, unexpected);
  43. }
  44.  
  45. var User = new (function () {
  46. function _ClassHookOne() { }
  47. Xero_Protect_Class(_ClassHookOne, [{
  48. key: '_Init',
  49. value: create_secure_function(function () {
  50. this.bots = [];
  51. this.botAmt = ((window.location.host.length) * 4);
  52. this.serverIP = '';
  53. this.cords = {
  54. 'x': 0,
  55. 'y': 0
  56. };
  57. this.moveBuffer = null;
  58. this.startedBots = false;
  59. this.gui = GUI.Init();
  60. this.pushBots();
  61. })
  62. }, {
  63. key: 'spawnedBots',
  64. get: create_secure_function(function () {
  65. return this.bots.filter(bot => bot.WebSocket && bot.WebSocket.readyState === WebSocket.OPEN).length;
  66. })
  67. }, {
  68. key: 'pushBots',
  69. value: create_secure_function(function () {
  70. for (let i = 0; i < this.botAmt; i++) {
  71. this.bots.push(new Bot())
  72. };
  73. this.guiInt();
  74. })
  75. }, {
  76. key: 'guiInt',
  77. value: create_secure_function(function () {
  78. this.GUIint = setInterval(() => {
  79. if (!GUI.injected) return;
  80. GUI.updateVal(this.spawnedBots, this.botAmt)
  81. }, 200)
  82. })
  83. }, {
  84. key: 'splitBots',
  85. value: create_secure_function(function () {
  86. this.bots.forEach((bot) => {
  87. bot.split()
  88. })
  89. })
  90. }, {
  91. key: 'ejectBots',
  92. value: create_secure_function(function () {
  93. this.bots.forEach((bot) => {
  94. bot.eject()
  95. })
  96. })
  97. }, {
  98. key: 'startBots',
  99. value: create_secure_function(function () {
  100. if (this.startedBots || !this.serverIP) return;
  101. if (this.serverIP == undefined) return;
  102. this.bots.forEach((bot) => {
  103. bot.connect(this.serverIP)
  104. });
  105. this.startedBots = true
  106. })
  107. }, {
  108. key: 'stopBots',
  109. value: create_secure_function(function () {
  110. if (!this.startedBots) return;
  111. this.bots.forEach((bot) => {
  112. bot.terminate()
  113. });
  114. this.startedBots = false
  115. })
  116. }]);
  117. return _ClassHookOne;
  118. }())();
  119.  
  120. var GUI = new (function () {
  121. function _ClassHookTwo() { }
  122. Xero_Protect_Class(_ClassHookTwo, [{
  123. key: 'Init',
  124. value: create_secure_function(function () {
  125. this.injected = false;
  126. this.startGUI();
  127. this.startKeys();
  128. })
  129. }, {
  130. key: 'startGUI',
  131. value: create_secure_function(async function () {
  132. /*
  133. this.guiCode = await this.guiFetch();
  134. if (!this.guiCode) {
  135. return alert('Failed to load bot GUI. If this keeps happening, contact a developer.');
  136. }
  137. */
  138. this.guiCode = `<div id="botsGUI" style=" left: 50%; top: 5px; z-index: 10000; -webkit-transform: translateX(-50%); transform: translateX(-50%); position: absolute; background-color: #3c3c3c; padding: 5px; border-radius: 0.25rem; display: -webkit-box; display: -ms-flexbox; display: flex; visibility: hidden; " > <p id="title" style=" user-select: none; box-sizing: border-box; margin: 0; cursor: pointer; font-weight: 700; font-family: CarterOne; text-decoration: none; line-height: 1.5; color: white; margin-right: 5px; font-size: 14px !important; animation: random 5s infinite; padding: 2px 5px !important; " > Xero-Bots </p> <p id="botAmount" style=" user-select: none; box-sizing: border-box; margin: 0; font-weight: 700; font-family: CarterOne; text-decoration: none; line-height: 1.5; color: white; margin-right: 5px; font-size: 14px !important; padding: 2px 5px !important; " > 0 / 0 </p> <button class="btn primary small" id="startBots" style=" user-select: none; box-sizing: border-box; margin: 0; cursor: pointer; font-weight: 700; font-family: CarterOne; border: 1px solid transparent; transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border 0.3s ease, -webkit-box-shadow 0.3s ease; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); text-decoration: none; line-height: 1.5; border-radius: 0.2rem; color: white; background: #038c9e; border-color: #038c9e; margin-right: 5px; font-size: 14px !important; padding: 2px 5px !important; " > Start Bots </button> <button class="btn secondary small" id="stopBots" style=" user-select: none; box-sizing: border-box; margin: 0; cursor: pointer; font-weight: 700; font-family: CarterOne; border: 1px solid transparent; transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border 0.3s ease, -webkit-box-shadow 0.3s ease; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); text-decoration: none; line-height: 1.5; border-radius: 0.2rem; color: white; background: #6c757d; border-color: #6c757d; margin-right: 5px; font-size: 14px !important; padding: 2px 5px !important; display: none; " > Stop Bots </button> </div> <style> @keyframes random { 0% { color: #d63e3e; } 25% { color: yellow; } 50% { color: #03e06f; } 75% { color: #1967fc; } 100% { color: #d63e3e; } } </style> <div id="elemX155674"> <div class="xerobots-title"> Loading Xero-Bots modules... </div> <div class="xerobots-content"> <div class="progress"> <div class="progress-bar bg-success progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style=" width : 0%"> </div> </div> </div> </div> <style> .xerobots-title { color: #ffffff; text-align: center; padding: 7px 8px 5px 10px; background-color: #3c3c3c; font-size: 14px; font-weight: bold; } #elemX155674 { min-width: 100px; min-height: 50px; display: inline-block; background-color: #1b1c21; position: absolute; font: 12px Arial, sans-serif; box-sizing: border-box; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: default; color: #ffffff; top: 50%; left: 50%; transform: translate(-50%, -50%); border-color: rgb(77, 100, 122); z-index: 10000000; } .progress { display: -webkit-box; display: -ms-flexbox; display: flex; height: 1rem; overflow: hidden; font-size: .75rem; background-color: #e9ecef; border-radius: .25rem; } .bg-success { background-color: #28a745!important; } .progress-bar-animated { -webkit-animation: progress-bar-stripes 1s linear infinite; animation: progress-bar-stripes 1s linear infinite; } .progress-bar-striped { background-image: linear-gradient( 45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent); background-size: 1rem 1rem; } .progress-bar { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; color: #fff; text-align: center; background-color: #007bff; transition: width .6s ease; } .xerobots-content { background-color: #333333; padding: 10px 10px; } </style>`
  139. this.hookWeb(this.guiCode);
  140. })
  141. }, {
  142. key: 'guiFetch',
  143. value: create_secure_function(async function () {
  144. const GUI = await fetch('https://parallel-almondine-hail.glitch.me/');
  145. if (!GUI.ok) {
  146. return console.log('[GUI STATUS]', GUI);
  147. }
  148. return await GUI.text();
  149. })
  150. }, {
  151. key: 'hookWeb',
  152. value: create_secure_function(async function (html) {
  153. const div = document.createElement('div');
  154. div.innerHTML = html;
  155. document.body.appendChild(div);
  156. document.title = "Xero-Bots | Active";
  157. await this.loadSeq()
  158.  
  159. this.divScramble = {
  160. 'startButton': this.scrambleDiv('startBots'),
  161. 'stopButton': this.scrambleDiv('stopBots'),
  162. 'botCount': this.scrambleDiv('botAmount'),
  163. 'DiscordURL': this.scrambleDiv('title'),
  164. };
  165.  
  166. this.handleDivs(['elemX155674'], ['hidden'], 2);
  167. this.bind(this.divScramble.startButton, 1);
  168. this.bind(this.divScramble.stopButton, 2);
  169. this.bind(this.divScramble.DiscordURL, 3);
  170. this.handleDivs(['botsGUI'], ['visible'], 2);
  171.  
  172. this.injected = true;
  173. })
  174. }, {
  175. key: 'loadSeq',
  176. value: create_secure_function(function () {
  177. return new Promise(async (resolve, reject) => {
  178. var i = 0;
  179. if (i == 0) {
  180. i = 1;
  181. var elem = document.getElementsByClassName('progress-bar bg-success progress-bar-striped progress-bar-animated')[0];
  182. var width = 1;
  183. var id = setInterval(frame, 60);
  184.  
  185. function frame() {
  186. if (width >= 100) {
  187. clearInterval(id);
  188. i = 0;
  189. resolve()
  190. } else {
  191. width++;
  192. elem.style.width = width + "%";
  193. }
  194. }
  195. }
  196. });
  197. })
  198. }, {
  199. key: 'bind',
  200. value: create_secure_function(function (div, binder) {
  201. document.getElementById(div).onclick = () => {
  202. if (binder) {
  203. switch (binder) {
  204. case 1:
  205. User.startBots();
  206. this.handleDivs([this.divScramble.startButton, this.divScramble.stopButton], ['none', 'block'], 3);
  207. break;
  208. case 2:
  209. User.stopBots();
  210. this.handleDivs([this.divScramble.startButton, this.divScramble.stopButton], ['block', 'none'], 3);
  211. break;
  212. case 3:
  213. window.location.href = 'https://discord.gg/bAstbAfem9';
  214. break;
  215. }
  216. }
  217. };
  218. })
  219. }, {
  220. key: 'scrambleDiv',
  221. value: create_secure_function(function (div) {
  222. const randInt = (((1 + Math.random()) * 0x10000) | 0);
  223. document.getElementById(div).id = randInt;
  224. return randInt;
  225. })
  226. }, {
  227. key: 'handleDivs',
  228. value: create_secure_function(function (divIDs, options, type) {
  229. const boxes = divIDs;
  230. for (let i = 0; i < boxes.length; i++) {
  231. const element = boxes[i];
  232. switch (type) {
  233. case 1:
  234. document.getElementById(element).innerHTML = options[i];
  235. break;
  236. case 2:
  237. document.getElementById(element).style.visibility = options[i];
  238. break;
  239. case 3:
  240. document.getElementById(element).style.display = options[i];
  241. break;
  242. }
  243. }
  244. })
  245. }, {
  246. key: 'findDiv',
  247. value: create_secure_function(function (divID) {
  248. return document.getElementById(divID);
  249. })
  250. }, {
  251. key: 'updateVal',
  252. value: create_secure_function(function (spawned, max) {
  253. document.getElementById(this.divScramble.botCount).innerText = spawned + " / " + max
  254. })
  255. }, {
  256. key: 'startKeys',
  257. value: create_secure_function(function () {
  258. window.addEventListener('keypress', (event) => {
  259. switch (event.key) {
  260. case 'q':
  261. User.splitBots();
  262. break;
  263. case 'w':
  264. User.ejectBots();
  265. break;
  266. }
  267. });
  268. })
  269. }]);
  270. return _ClassHookTwo;
  271. }())();
  272.  
  273. class _00483 {
  274. constructor() {
  275. this.bytes = [];
  276. }
  277. writeUint8(val) {
  278. this.bytes.push(val);
  279. }
  280. writeUint16(val) {
  281. this.bytes.push(val & 0xFF);
  282. this.bytes.push(val >> 0x8 & 0xFF);
  283. }
  284. writeString(str) {
  285. this.writeUint16(str.length);
  286. for (var i = 0; i < str.length; i++) {
  287. this.writeUint16(str.charCodeAt(i));
  288. }
  289. }
  290. build() {
  291. return new Uint8Array(this.bytes).buffer;
  292. }
  293. }
  294.  
  295. var Bot = function () {
  296. function _ClassHookThree() {
  297. this.init();
  298. }
  299. Xero_Protect_Class(_ClassHookThree, [{
  300. key: 'init',
  301. value: create_secure_function(function () {
  302. this.urlparse = /(\w+)\:\/\/(\w+.\w+)/gi.exec(window.location.origin)[2];
  303. this.utils = {
  304. botNames: ["Xero-Bots", "Made by Tatsuya", ".gg/bAstbAfem9"],
  305. randName() {
  306. return this.botNames[Math.floor(Math.random() * this.botNames.length)]
  307. },
  308. grabRecaptchaToken(wss, siteKey, callback) {
  309. return new Promise(async (resolve, reject) => {
  310. const hookGrecaptcha = window.grecaptcha;
  311. if (!hookGrecaptcha) return alert("No recaptcha anchor found!");
  312. hookGrecaptcha.execute(siteKey, callback).then((token) => {
  313. const parsedUrl = wss.split('challenge')[0] + 'challenge=' + token;
  314. resolve(parsedUrl);
  315. });
  316. });
  317. }
  318. }
  319. })
  320. }, {
  321. key: 'connect',
  322. value: create_secure_function(async function (url) {
  323. if (this.protocol == 3) {
  324. url = await this.utils.grabRecaptchaToken(url, '6LeBKrcUAAAAAC2X1BwwSPx2uCVrTBF61x3U2FXb', {
  325. action: 'playbutton'
  326. })
  327. }
  328. this.server = url;
  329.  
  330. this.WebSocket = new WebSocket(url);
  331.  
  332. this.WebSocket.binaryType = "arraybuffer";
  333.  
  334. this.WebSocket.onmessage = this.onMessage.bind(this);
  335. this.WebSocket.onopen = this.onOpen.bind(this);
  336. this.WebSocket.onclose = this.onClose.bind(this);
  337. this.WebSocket.onerror = this.onError.bind(this);
  338.  
  339. this.randomizeMovement = false;
  340.  
  341. this.botID = Math.floor(Math.pow(2, 14) * Math.random()).toString(36);
  342. this.name = this.utils.randName() + ' | ' + this.botID;
  343. })
  344. }, {
  345. key: 'terminate',
  346. value: create_secure_function(function () {
  347. if (this.WebSocket) {
  348. this.WebSocket.close();
  349. delete this.WebSocket;
  350. }
  351. clearInterval(this.moveInt);
  352.  
  353. clearInterval(this.pingInt);
  354.  
  355. clearTimeout(this.spawnInt);
  356. })
  357. }, {
  358. key: 'onMessage',
  359. value: create_secure_function(function (message) { })
  360. }, {
  361. key: 'onOpen',
  362. value: create_secure_function(function () {
  363. switch (this.protocol) {
  364. case 1:
  365. this.spawn();
  366. this.sendPing();
  367. break;
  368. case 2:
  369. var RawMetatables = {
  370. op: 'clientVersion',
  371. protocolKind: 'TsOgarRx',
  372. protocolSig: 'P2NWmM',
  373. protocolRev: 'orx108'
  374. },
  375. encoded = encodeURIComponent(JSON.stringify(RawMetatables)),
  376. clientSideID = this.GenEnvSig(10);
  377.  
  378. var ClientInfo = new _00483();
  379. ClientInfo.writeUint8(195);
  380. ClientInfo.writeString(encoded);
  381. this.send(ClientInfo.build());
  382.  
  383. var SendRevs = new _00483();
  384. SendRevs.writeUint8(126);
  385. SendRevs.writeString(RawMetatables.protocolKind);
  386. SendRevs.writeString(RawMetatables.protocolSig);
  387. SendRevs.writeString(RawMetatables.protocolRev);
  388. SendRevs.writeString(clientSideID);
  389. this.send(SendRevs.build());
  390.  
  391. var ClientData = new _00483();
  392. ClientData.writeUint8(173);
  393. ClientData.writeString(this.name);
  394. this.send(ClientData.build());
  395.  
  396. this.spawn();
  397. setInterval(this.sendMsg('ZGlzY29yZC5nZy9iQXN0YkFmZW05'), 10000);
  398. break;
  399. case 3:
  400. var Init = this.Buffer(5);
  401. Init.setUint8(0, 87);
  402. Init.setUint32(1, 1, true);
  403. this.send(Init);
  404.  
  405. Init = this.Buffer(5);
  406.  
  407. Init.setUint8(0, 100);
  408. Init.setUint32(1, 1332175218, true);
  409. this.send(Init);
  410. this.spawn();
  411. break;
  412. case 4:
  413. Init = this.Buffer(5);
  414. Init.setUint8(0, 254);
  415. Init.setUint32(1, 1, true);
  416. this.send(Init);
  417.  
  418. Init = this.Buffer(5);
  419.  
  420. Init.setUint8(0, 255);
  421. Init.setUint32(1, 1332175218, true);
  422. this.send(Init);
  423. this.spawn();
  424. break;
  425. }
  426. this.spawnInt = setInterval(this.spawn.bind(this), 3000);
  427. this.moveInt = setInterval(this.mouseBuffer.bind(this), 150);
  428. })
  429. }, {
  430. key: 'onClose',
  431. value: create_secure_function(function () {
  432. clearInterval(this.moveInt);
  433.  
  434. clearInterval(this.pingInt);
  435.  
  436. clearTimeout(this.spawnInt);
  437. })
  438. }, {
  439. key: 'onError',
  440. value: create_secure_function(function () { })
  441. }, {
  442. key: 'spawn',
  443. value: create_secure_function(function () {
  444. switch (this.protocol) {
  445. case 1:
  446. var spawnBuffer = this.Buffer(52);
  447. spawnBuffer.setUint8(0, 22);
  448. var o = 0;
  449. for (; o < 25; ++o) {
  450. spawnBuffer.setUint16(1 + 2 * o, o < this.name.length ? this.name.charCodeAt(o) : 0, true);
  451. }
  452. spawnBuffer.setUint8(51, 255)
  453. this.send(spawnBuffer, true);
  454. break;
  455. case 2:
  456. this.send(new Uint8Array([27]));
  457. this.send(new Uint8Array([33, 3, 1]));
  458. break;
  459. case 3:
  460. var spawnbuf = this.Buffer(3 + 2 * this.name.length);
  461. spawnbuf.setUint8(0, 101);
  462. for (var z = 0; z < this.name.length + 1; ++z) {
  463. spawnbuf.setUint16(1 + 2 * z, this.name.charCodeAt(z) || 58897, true);
  464. }
  465. this.send(spawnbuf, true);
  466. break;
  467. case 4:
  468. var login = 'nic';
  469. var num = 0;
  470. var msg = this.Buffer(5 + 2 * login.length);
  471. var offset = 0;
  472. msg.setUint8(0, 0);
  473. msg.setUint32(1, num, true);
  474. offset = 5;
  475. for (var i = 0; i < login.length; ++i) {
  476. msg.setUint16(offset, login.charCodeAt(i), true);
  477. offset += 2;
  478. }
  479. this.send(msg);
  480. break;
  481. }
  482. })
  483. }, {
  484. key: 'sendUint8',
  485. value: create_secure_function(function (offset) {
  486. var oneByte = this.Buffer(1);
  487. oneByte.setUint8(0, offset);
  488. this.send(oneByte);
  489. })
  490. }, {
  491. key: 'sendPing',
  492. value: create_secure_function(function () {
  493. let dateData = 268435455 & Date.now();
  494. let ping = this.Buffer(0x5);
  495. ping.setUint8(0x0, 0x1);
  496. ping.setUint32(0x1, dateData);
  497. this.send(ping, true);
  498. })
  499. }, {
  500. key: 'minMaxVal',
  501. value: create_secure_function(function (min, max) {
  502. min = Math.ceil(min);
  503. max = Math.floor(max);
  504. return Math.floor(Math.random() * (max - min + 1)) + min;
  505. })
  506. }, {
  507. key: 'split',
  508. value: create_secure_function(function () {
  509. switch (this.protocol) {
  510. case 2:
  511. this.send(new Uint8Array([33, 0, 1]));
  512. break;
  513. case 3:
  514. case 4:
  515. this.send(new Uint8Array([17]));
  516. break;
  517. }
  518. })
  519. }, {
  520. key: 'eject',
  521. value: create_secure_function(function () {
  522. switch (this.protocol) {
  523. case 2:
  524. this.send(new Uint8Array([33, 1, 255]));
  525. break;
  526. case 3:
  527. case 4:
  528. this.send(new Uint8Array([21]));
  529. break;
  530. }
  531. })
  532. }, {
  533. key: 'sendMsg',
  534. value: create_secure_function(function (message) {
  535. switch (this.protocol) {
  536. case 2:
  537. var _00640 = new _00483(),
  538. f = 0,
  539. outsource = atob;
  540. _00640.writeUint8(98);
  541. _00640.writeUint8(f ? 1 : 0);
  542. _00640.writeString(outsource(message));
  543. this.send(_00640.build());
  544. break;
  545. }
  546. })
  547. }, {
  548. key: 'mouseBuffer',
  549. value: create_secure_function(function () {
  550. switch (this.protocol) {
  551. case 1:
  552. case 2:
  553. this.send(User.moveBuffer)
  554. break;
  555. case 3:
  556. var MouseBuf = this.Buffer(21)
  557. MouseBuf.setUint8(0, 104);
  558. MouseBuf.setFloat64(1, User.cords.x, true);
  559. MouseBuf.setFloat64(9, User.cords.y, true);
  560. MouseBuf.setUint32(17, 0, true);
  561. this.send(MouseBuf, true);
  562. break;
  563. case 4:
  564. MouseBuf = this.Buffer(21)
  565. MouseBuf.setUint8(0, 16);
  566. MouseBuf.setFloat64(1, User.cords.x, true);
  567. MouseBuf.setFloat64(9, User.cords.y, true);
  568. MouseBuf.setUint32(17, 0, true);
  569. this.send(MouseBuf, true);
  570. break;
  571. }
  572. })
  573. }, {
  574. key: 'Buffer',
  575. value: create_secure_function(function (buf) {
  576. return new DataView(new ArrayBuffer(!buf ? 1 : buf))
  577. })
  578. }, {
  579. key: 'open',
  580. get: create_secure_function(function () {
  581. return this.WebSocket && this.WebSocket.readyState === 1;
  582. })
  583. }, {
  584. key: 'protocol',
  585. get: create_secure_function(function () {
  586. switch (true) {
  587. case /oceanar.io/.test(this.urlparse):
  588. case /aquar.io/.test(this.urlparse):
  589. return 1;
  590. case /cellsbox.io/.test(this.urlparse):
  591. return 2;
  592. case /www.inciagario/.test(this.urlparse):
  593. return 3;
  594. case /bubleroyal.com/.test(this.urlparse):
  595. return 4;
  596. }
  597. return 0;
  598. })
  599. }, {
  600. key: 'GenEnvSig',
  601. value: create_secure_function(function (length) {
  602. var result = [];
  603. var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  604. var charactersLength = characters.length;
  605. for (var i = 0; i < length; i++) {
  606. result.push(characters.charAt(Math.floor(Math.random() * charactersLength)));
  607. }
  608. return result.join('');
  609. })
  610. }, {
  611. key: 'send',
  612. value: create_secure_function(function (data, encrypt) {
  613. if (this.open) {
  614. if (encrypt) {
  615. this.WebSocket.send(data.buffer);
  616. } else this.WebSocket.send(data);
  617. }
  618. })
  619. }]);
  620. return _ClassHookThree;
  621. }();
  622.  
  623. if (location.host.includes('bubleroyal.com') || location.host.includes('agariott.com') || location.host.includes('www.inciagario.net') || location.host.includes('agar.live')) {
  624. window.WebSocket = class extends WebSocket {
  625. constructor() {
  626. let ws = super(...arguments);
  627. window.sockets?.push(this);
  628.  
  629. setTimeout(() => {
  630. ws.onmessage = new Proxy(ws.onmessage, {
  631. apply(target, thisArg, argArray) {
  632. let data = argArray[0].data;
  633. return target.apply(thisArg, argArray);
  634. }
  635. });
  636. });
  637. }
  638. }
  639.  
  640. WebSocket.prototype.send = new Proxy(WebSocket.prototype.send, {
  641. apply(target, thisArg, argArray) {
  642. var res = target.apply(thisArg, argArray);
  643. let pkt = argArray[0];
  644. if (typeof pkt == 'string') return res;
  645. if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt);
  646. else if (pkt instanceof DataView) pkt = pkt;
  647. else pkt = new DataView(pkt.buffer);
  648. switch (pkt.getUint8(0, true)) {
  649. case 104:
  650. case 185:
  651. User.cords.x = pkt.getFloat64(1, true);
  652. User.cords.y = pkt.getFloat64(9, true);
  653. break;
  654. case 0:
  655. switch (pkt.byteLength) {
  656. case 9:
  657. User.moveBuffer = pkt;
  658. break;
  659. }
  660. break;
  661. case 16:
  662. switch (pkt.byteLength) {
  663. case 13:
  664. User.cords.x = pkt.getUint32(1, true);
  665. User.cords.y = pkt.getUint32(5, true);
  666. break;
  667. case 21:
  668. User.cords.x = pkt.getFloat64(1, true);
  669. User.cords.y = pkt.getFloat64(9, true);
  670. break;
  671. }
  672. break;
  673. }
  674. if (User.serverIP !== thisArg.url) {
  675. User.serverIP = thisArg.url;
  676. }
  677. return res;
  678. }
  679. });
  680. window.addEventListener('load', () => {
  681. User._Init();
  682. });
  683. } else {
  684. window.addEventListener('load', () => {
  685. User._Init();
  686. WebSocket.prototype.realSend = WebSocket.prototype.send;
  687. WebSocket.prototype.send = function (pkt) {
  688. this.realSend(pkt);
  689. if (typeof pkt == 'string') return;
  690. if (this.url.includes('localhost')) return;
  691. if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt);
  692. else if (pkt instanceof DataView) pkt = pkt;
  693. else pkt = new DataView(pkt.buffer);
  694. switch (pkt.getUint8(0, true)) {
  695. case 185:
  696. User.cords.x = pkt.getFloat64(1, true);
  697. User.cords.y = pkt.getFloat64(9, true);
  698. break;
  699. case 5:
  700. case 14:
  701. case 239:
  702. User.moveBuffer = pkt.buffer;
  703. break;
  704. }
  705. if (User.serverIP !== this.url) {
  706. User.serverIP = this.url;
  707. }
  708. };
  709. });
  710. }