Xero-Bots | .io Bots 2022

The best bots for popular agar.io clone games.

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

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