Xero-Bots | .io Bots 2022

The best bots for popular agar.io clone games.

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

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