Xero-Bots | .io Bots 2022

The best bots for popular agar.io clone games.

当前为 2022-08-21 提交的版本,查看 最新版本

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