Free Agario.in Bots (Vanilla Version) updated

Free and Real open source agario bots (tags: ogario, legend mod, vanilla, free bots, unlimited, hacks, infinity, agar.io, cheat, miniclip, agar)

  1. // ==UserScript==
  2. // @name Free Agario.in Bots (Vanilla Version) updated
  3. // @namespace Free and Real agario bots updated
  4. // @version 2.0.5
  5. // @description Free and Real open source agario bots (tags: ogario, legend mod, vanilla, free bots, unlimited, hacks, infinity, agar.io, cheat, miniclip, agar)
  6. // @author chance
  7. // @grant none
  8. // @run-at document-start
  9. // @match *://*/*
  10. // ==/UserScript==
  11. /* START OF USER SETTINGS */
  12. window.options = {
  13. settings: {
  14. "EXTENDED_ZOOM": {
  15. "text": "Extended Zoom",
  16. "type": "checkbox",
  17. "value": true
  18. },
  19. "DRAW_MAP_GRID": {
  20. "text": "Grid",
  21. "type": "checkbox",
  22. "value": false
  23. },
  24. "SHOW_ALL_PLAYERS_MASS": {
  25. "text": "Show Mass (All players)",
  26. "type": "checkbox",
  27. "value": true
  28. },
  29. },
  30. hotkeys: {
  31. "BOTS_SPLIT_KEY": {
  32. "text": "Bot Split Key",
  33. "key": "T",
  34. "keycode": 84,
  35. },
  36. "BOTS_FEED_KEY": {
  37. "text": "Bot Feed Key",
  38. "key": "A",
  39. "keycode": 65,
  40. },
  41. "BOTS_AI_KEY": {
  42. "text": "Bot AI Key",
  43. "key": "F",
  44. "keycode": 70,
  45. },
  46. "MACRO_FEED_KEY": {
  47. "text": "Macro Feed Key",
  48. "key": "E",
  49. "keycode": 69,
  50. },
  51. "DOUBLE_SPLIT_KEY": {
  52. "text": "Double Split Key",
  53. "key": "Q",
  54. "keycode": 81,
  55. },
  56. "SIXTEEN_SPLIT_KEY": {
  57. "text": "Sixteen Split Key",
  58. "key": "R",
  59. "keycode": 82,
  60. },
  61. }
  62. }
  63. if(localStorage.getItem('nebula-hotkeys')) window.options.hotkeys =JSON.parse(localStorage.getItem('nebula-hotkeys'));
  64. if(localStorage.getItem('nebula-settings')) window.options.settings =JSON.parse(localStorage.getItem('nebula-settings'));
  65. window.changeKey = (name, event) => {
  66. event.preventDefault();
  67. $(`#${name}`).val(event.key.toLocaleUpperCase())
  68. let key = window.options.hotkeys[name];
  69. key["key"] = event.key.toLocaleUpperCase();
  70. key["keycode"] = event.keyCode;
  71. checkDuplicates(name, event.keyCode);
  72. localStorage.setItem('nebula-hotkeys', JSON.stringify(window.options.hotkeys));
  73. }
  74. window.checkboxChange = (name) => {
  75. let setting = window.options.settings[name];
  76. setting["value"] = document.getElementById(name).checked;
  77. localStorage.setItem('nebula-settings', JSON.stringify(window.options.settings));
  78. };
  79. window.checkDuplicates = (keyname, keycode) => {
  80. for (var name in window.options.hotkeys) {
  81. var key = window.options.hotkeys[name];
  82. if(name == keyname) continue;
  83. if(keycode == key.keycode) key.keycode = 0, key.key = "", $(`#${name}`).val("");
  84. }
  85. }
  86. window.setUpHotkeys = () => {
  87. for (var name in window.options.hotkeys) {
  88. var key = window.options.hotkeys[name];
  89. let html =
  90. `<div class="row" name="${name}">
  91. <span class="title">${key.text}</span>
  92. <input id="${name}" onkeydown="changeKey('${name}', event)" class="key" value="${key.key.toLocaleUpperCase()}">
  93. </div>`
  94. $("#hotkeys").append(html);
  95. }
  96. }
  97. window.getOption = (name) => {
  98. if(document.getElementById(name))return document.getElementById(name).checked
  99. else return false
  100. }
  101. window.setUpOptions = () => {
  102. for (var name in window.options.settings) {
  103. var option = window.options.settings[name];
  104. let html =
  105. `<div class="row" name="${name}">
  106. <span class="title">${option.text}</span>
  107. <input id=${name} onchange="checkboxChange('${name}')" class="checkbox" type="checkbox">
  108. </div>
  109. `
  110. $("#settings").append(html);
  111. if(option["value"] == true) $(`#${name}`).click();
  112. }
  113. }
  114. window.SERVER_HOST = 'ws://localhost:8083' // Hostname/IP of the server where the bots are running [Default = localhost (your own pc)]
  115. window.ZOOM_SPEED = 0.85 // Numerical value that indicates the speed of the mouse wheel when zooming, value must be between 0.01-0.99 [Default = 0.85]
  116. window.EXTENDED_ZOOM = true // Boolean value that indicates whether to extend the zoom or not, possible values are true and false [Default = true]
  117. window.DRAW_MAP_GRID = false // Boolean value that indicates whether to draw the map grid or not, possible values are true and false [Default = false]
  118. window.SHOW_ALL_PLAYERS_MASS = true // Boolean value that indicates whether to show all players mass or not, possible values are true and false [Default = true]
  119. /* END OF USER SETTINGS */
  120. class Writer {
  121. constructor(size) {
  122. this.dataView = new DataView(new ArrayBuffer(size))
  123. this.byteOffset = 0
  124. }
  125. writeUint8(value) {
  126. this.dataView.setUint8(this.byteOffset++, value)
  127. }
  128. writeInt32(value) {
  129. this.dataView.setInt32(this.byteOffset, value, true)
  130. this.byteOffset += 4
  131. }
  132. writeUint32(value) {
  133. this.dataView.setUint32(this.byteOffset, value, true)
  134. this.byteOffset += 4
  135. }
  136. writeString(string) {
  137. for (let i = 0; i < string.length; i++) this.writeUint8(string.charCodeAt(i))
  138. this.writeUint8(0)
  139. }
  140. }
  141. window.buffers = {
  142. startBots(url, protocolVersion, clientVersion, userStatus, botsName, botsAmount) {
  143. const writer = new Writer(13 + url.length + botsName.length)
  144. writer.writeUint8(0)
  145. writer.writeString(url)
  146. writer.writeUint32(protocolVersion)
  147. writer.writeUint32(clientVersion)
  148. writer.writeUint8(Number(userStatus))
  149. writer.writeString(botsName)
  150. writer.writeUint8(botsAmount)
  151. return writer.dataView.buffer
  152. },
  153. mousePosition(x, y) {
  154. const writer = new Writer(9)
  155. writer.writeUint8(6)
  156. writer.writeInt32(x)
  157. writer.writeInt32(y)
  158. return writer.dataView.buffer
  159. }
  160. }
  161. window.connection = {
  162. ws: null,
  163. connect() {
  164. this.ws = new WebSocket(`${window.SERVER_HOST}`)
  165. this.ws.binaryType = 'arraybuffer'
  166. this.ws.onopen = this.onopen.bind(this)
  167. this.ws.onmessage = this.onmessage.bind(this)
  168. this.ws.onclose = this.onclose.bind(this)
  169. },
  170. send(buffer) {
  171. if (this.ws && this.ws.readyState === WebSocket.OPEN) this.ws.send(buffer)
  172. },
  173. onopen() {
  174. document.getElementById('userStatus').style.color = '#00C02E'
  175. document.getElementById('userStatus').innerText = 'Connected'
  176. document.getElementById('connect').disabled = true
  177. document.getElementById('startBots').disabled = false
  178. document.getElementById('stopBots').disabled = false
  179. },
  180. onmessage(message) {
  181. const dataView = new DataView(message.data)
  182. switch (dataView.getUint8(0)) {
  183. case 0:
  184. document.getElementById('startBots').disabled = true
  185. document.getElementById('stopBots').disabled = false
  186. document.getElementById('startBots').style.display = 'none'
  187. document.getElementById('stopBots').style.display = 'inline'
  188. document.getElementById('stopBots').innerText = 'Stop Bots'
  189. window.user.startedBots = true
  190. break
  191. case 1:
  192. document.getElementById('stopBots').disabled = true
  193. document.getElementById('stopBots').innerText = 'Stopping Bots...'
  194. break
  195. case 2:
  196. document.getElementById('botsAI').style.color = '#DA0A00'
  197. document.getElementById('botsAI').innerText = 'Disabled'
  198. document.getElementById('startBots').disabled = false
  199. document.getElementById('stopBots').disabled = true
  200. document.getElementById('startBots').style.display = 'inline'
  201. document.getElementById('stopBots').style.display = 'none'
  202. document.getElementById('stopBots').innerText = 'Stop Bots'
  203. window.user.startedBots = false
  204. window.bots.ai = false
  205. break
  206. case 3:
  207. alert('Your IP has captcha and bots are unable to spawn, change your ip with a VPN or something to one that doesn\'t has captcha in order to use the bots')
  208. break
  209. case 4:
  210. //Connected Bot count = getUint8(1)
  211. //Spawned Bot count = getUint8(2)
  212. //Server player amount = getUint8(3)
  213. $('#botCount').html(`${dataView.getUint8(1)}/${dataView.getUint8(2)}/${window.bots.amount}`)
  214. // $('#slots').html(dataView.getUint8(3) + "/200")
  215. break;
  216. case 5:
  217. $('#slots').html(dataView.getUint8(1) + "/200")
  218. break;
  219. }
  220. },
  221. onclose() {
  222. document.getElementById('userStatus').style.color = '#DA0A00'
  223. document.getElementById('userStatus').innerText = 'Disconnected'
  224. document.getElementById('botsAI').style.color = '#DA0A00'
  225. document.getElementById('botsAI').innerText = 'Disabled'
  226. document.getElementById('connect').disabled = false
  227. document.getElementById('startBots').disabled = true
  228. document.getElementById('stopBots').disabled = true
  229. document.getElementById('startBots').style.display = 'inline'
  230. document.getElementById('stopBots').style.display = 'none'
  231. window.user.startedBots = false
  232. window.bots.ai = false
  233. }
  234. }
  235. window.game = {
  236. url: '',
  237. protocolVersion: 0,
  238. clientVersion: 0
  239. }
  240. window.user = {
  241. startedBots: false,
  242. isAlive: false,
  243. mouseX: 0,
  244. mouseY: 0,
  245. offsetX: 0,
  246. offsetY: 0,
  247. macroFeedInterval: null
  248. }
  249. window.bots = {
  250. name: '',
  251. amount: 0,
  252. ai: false
  253. }
  254. function modifyCore(core) {
  255. return core
  256. .replace(/if\(\w+\.MC&&\w+\.MC\.onPlayerSpawn\)/, `
  257. $&
  258. window.user.isAlive = true
  259. if(window.user.startedBots) window.connection.send(new Uint8Array([5, Number(window.user.isAlive)]).buffer)
  260. `)
  261. .replace(/if\(\w+\.MC&&\w+\.MC\.onPlayerDeath\)/, `
  262. $&
  263. window.user.isAlive = false
  264. if(window.user.startedBots) window.connection.send(new Uint8Array([5, Number(window.user.isAlive)]).buffer)
  265. `)
  266. .replace(/new\s+WebSocket\((\w+\(\w+\))\)/, `
  267. $&
  268. if(window.user.startedBots) window.connection.send(new Uint8Array([1]).buffer)
  269. window.game.url = $1
  270. window.user.isAlive = false
  271. window.user.macroFeedInterval = null
  272. `).replace(/(\w+)=~~\(\+\w+\[\w+\+\d+>>3]\+\s+\+\(\(\w+\[\w+\+\d+>>2]\|0\)-\(\(\w+\[\d+]\|0\)\/2\|0\)\|0\)\/\w+\);(\w+)=~~\(\+\w+\[\w+\+\d+>>3]\+\s+\+\(\(\w+\[\w+\+\d+>>2]\|0\)-\(\(\w+\[\d+]\|0\)\/2\|0\)\|0\)\/\w+\)/, `
  273. $&
  274. window.user.mouseX = $1 - window.user.offsetX
  275. window.user.mouseY = $2 - window.user.offsetY
  276. if(window.user.startedBots && window.user.isAlive) window.connection.send(window.buffers.mousePosition(window.user.mouseX, window.user.mouseY))
  277. `)
  278. .replace(/\w+\[\w+\+272>>3]=(\w+);\w+\[\w+\+280>>3]=(\w+);\w+\[\w+\+288>>3]=(\w+);\w+\[\w+\+296>>3]=(\w+)/, `
  279. $&
  280. if(~~($3 - $1) === 14142 && ~~($4 - $2) === 14142){
  281. window.user.offsetX = ($1 + $3) / 2
  282. window.user.offsetY = ($2 + $4) / 2
  283. }
  284. `)
  285. .replace(/\(\.9,/, '(window.ZOOM_SPEED,')
  286. .replace(/;if\((\w+)<1\.0\)/, ';if($1 < (!getOption("EXTENDED_ZOOM")))')
  287. .replace(/(\w+\(\d+,\w+\|0,\.5,\.5\)\|0);(\w+\(\d+,\w+\|0,\.5,50\.5\)\|0);(\w+\(\d+,\w+\|0,\.5,\.5\)\|0);(\w+\(\d+,\w+\|0,50\.5,\.5\)\|0)/, `
  288. $1
  289. if(window.getOption("DRAW_MAP_GRID")) $2
  290. $3
  291. if(window.getOption("DRAW_MAP_GRID")) $4
  292. `)
  293. .replace(/while\(0\);(\w+)=\(\w+\|0\)!=\(\w+\|0\);/, `
  294. $&
  295. if(window.getOption("SHOW_ALL_PLAYERS_MASS")) $1 = true
  296. `)
  297. }
  298. function setKeysEvents() {
  299. document.addEventListener('keydown', e => {
  300. if (!document.getElementById('overlays')) {
  301. switch (e.keyCode) {
  302. case options.hotkeys["BOTS_SPLIT_KEY"].keycode:
  303. if (window.user.startedBots && window.user.isAlive) window.connection.send(new Uint8Array([2]).buffer)
  304. break
  305. case options.hotkeys["BOTS_FEED_KEY"].keycode:
  306. if (window.user.startedBots && window.user.isAlive) window.connection.send(new Uint8Array([3]).buffer)
  307. break
  308. case options.hotkeys["BOTS_AI_KEY"].keycode:
  309. if (window.user.startedBots && window.user.isAlive) {
  310. if (!window.bots.ai) {
  311. document.getElementById('botsAI').style.color = '#00C02E'
  312. document.getElementById('botsAI').innerText = 'Enabled'
  313. window.bots.ai = true
  314. window.connection.send(new Uint8Array([4, Number(window.bots.ai)]).buffer)
  315. } else {
  316. document.getElementById('botsAI').style.color = '#DA0A00'
  317. document.getElementById('botsAI').innerText = 'Disabled'
  318. window.bots.ai = false
  319. window.connection.send(new Uint8Array([4, Number(window.bots.ai)]).buffer)
  320. }
  321. }
  322. break
  323. case options.hotkeys["MACRO_FEED_KEY"].keycode:
  324. if (!window.user.macroFeedInterval) {
  325. window.core.eject()
  326. window.user.macroFeedInterval = setInterval(window.core.eject, 80)
  327. }
  328. break
  329. case options.hotkeys["DOUBLE_SPLIT_KEY"].keycode:
  330. window.core.split()
  331. setTimeout(window.core.split, 40)
  332. break
  333. case options.hotkeys["SIXTEEN_SPLIT_KEY"].keycode:
  334. window.core.split()
  335. setTimeout(window.core.split, 40)
  336. setTimeout(window.core.split, 80)
  337. setTimeout(window.core.split, 120)
  338. break
  339. }
  340. }
  341. })
  342. document.addEventListener('keyup', e => {
  343. if (!document.getElementById('overlays') && e.keyCode === options.hotkeys["MACRO_FEED_KEY"].keycode && window.user.macroFeedInterval) {
  344. clearInterval(window.user.macroFeedInterval)
  345. window.user.macroFeedInterval = null
  346. }
  347. })
  348. }
  349. function setGUI() {
  350. let menuhtml = `<div id="inputs" class="menu-panel" >
  351. <div class="inputs-tab-bar">
  352. <span id="settingsbutton"class="inputs-tab active" target="#settings"><i class="fa fa-keyboard-o"></i> <span>Settings</span></span>
  353. <span id="hotkeysbutton" class="inputs-tab" target="#hotkeys"><i class="fa fa-keyboard-o"></i> <span>Hotkeys</span></span>
  354. <span class="inputs-tab close" target="#close">X</span>
  355. </div>
  356. <div class="inputs-menu-container">
  357. <div id="settings" class="inputs-menu active"></div>
  358. <div id="hotkeys" style="display:none;" class="inputs-menu ps ps--theme_default">
  359. </div>
  360. </div>`
  361. $("#mainui-play").append(menuhtml);
  362. document.getElementById('advertisement').innerHTML = `
  363. <button id="botsPanel">Options</button>
  364. <h3 id="botsInfo">
  365. <a href="https://discord.gg/JUfpR9k" target="_blank">Free Agar.io Bots</a>
  366. </h3>
  367. <h5 id="botsAuthor">
  368. Developed by <a href="https://github.com/jimboy3100/jimboy3100.github.io/blob/master/ExampleScripts/agario-bots2/" target="_blank">Nel, </a><a href="http://legendmod.ml/" target="_blank">Jimboy3100</a>
  369. </h5>
  370. <span id="statusText">Status: <b id="userStatus">Disconnected</b></span>
  371. <br>
  372. <br>
  373. <span id="aiText">Bots AI: <b id="botsAI">Disabled</b></span>
  374. <br>
  375. <input type="text" id="botsName" placeholder="Bots Name" maxlength="15" spellcheck="false">
  376. <input type="number" id="botsAmount" placeholder="Bots Amount" min="10" max="199" spellcheck="false">
  377. <input type="text" id="botsRemoteIP" placeholder="ws://localhost:8083" maxlength="100" spellcheck="false">
  378. <button id="connect">Connect</button>
  379. <br>
  380. <button id="startBots" disabled>Start Bots</button>
  381. <button id="stopBots">Stop Bots</button>
  382. `
  383. if (localStorage.getItem('localStoredBotsName') !== null) {
  384. window.bots.name = localStorage.getItem('localStoredBotsName')
  385. document.getElementById('botsName').value = window.bots.name
  386. }
  387. if (localStorage.getItem('localStoredBotsAmount') !== null) {
  388. window.bots.amount = JSON.parse(localStorage.getItem('localStoredBotsAmount'))
  389. document.getElementById('botsAmount').value = String(window.bots.amount)
  390. }
  391. var storedbotsRemoteIP = localStorage.getItem("localstoredBotsRemoteIP");
  392. if (storedbotsRemoteIP==null || storedbotsRemoteIP==""){
  393. storedbotsRemoteIP = "ws://localhost:8083";
  394. }
  395. window.bots.remoteIP = storedbotsRemoteIP;
  396. window.SERVER_HOST = storedbotsRemoteIP;
  397. $('#botsRemoteIP').val(storedbotsRemoteIP)
  398. window.setUpHotkeys();
  399. window.setUpOptions();
  400. }
  401. function setGUIStyle() {
  402. document.getElementsByTagName('head')[0].innerHTML += `
  403. <style type="text/css">
  404. .menu-panel {
  405. z-index: 1;
  406. border-radius: 5px;
  407. background: rgba(255, 255, 255, 0.95);
  408. }
  409. #hotkeys .row, #settings .row{
  410. padding: 10px;
  411. background: #f8f8f8;
  412. border-bottom: 1px solid #000;
  413. }
  414. #hotkeys .row .title, #settings .row .title{
  415. font-family: Arial;
  416. text-transform: uppercase;
  417. font-weight: 600;
  418. font-size: 13px;
  419. }
  420. #hotkeys .row .key, #settings .row .key {
  421. float: right;
  422. margin-right: 6px;
  423. font-family: Arial;
  424. background: #111;
  425. padding: 2px 5px;
  426. border: 2px solid #444;
  427. box-shadow: 0px 0px 2px #000;
  428. color: #8e8e8e;
  429. transform: translateY(-3px);
  430. text-align: center;
  431. width: 55px;
  432. font-weight: 700;
  433. cursor: pointer;
  434. }
  435. #settings .row .checkbox {
  436. float: right;
  437. margin-right: 6px;
  438. font-family: Arial;
  439. padding: 2px 5px;
  440. color: #8e8e8e;
  441. transform: translateY(3px);
  442. text-align: center;
  443. width: 55px;
  444. font-weight: 700;
  445. cursor: pointer;
  446. }
  447. #inputs {
  448. display: none;
  449. width: 400px;
  450. height: 500px;
  451. position: absolute;
  452. left: 50%;
  453. top: 50%;
  454. transform: translate(-50%, -50%);
  455. }
  456. .input-hidden {
  457. color: transparent !important;
  458. }
  459. .input-hidden::selection {
  460. background: #777 !important;
  461. color: transparent !important;
  462. }
  463. .inputs-tab {
  464. cursor: pointer;
  465. background: #fff;
  466. padding: 6px 10px;
  467. border-radius: 4px 4px 0px 0px;
  468. }
  469. .inputs-tab.active {
  470. background: #fff;
  471. }
  472. .inputs-tab-bar {
  473. color: #000;
  474. font-size: 14px;
  475. font-family: Arial;
  476. height: 22px;
  477. }
  478. .inputs-menu-container {
  479. width: 100%;
  480. height: 478px;
  481. background: rgba(51, 51, 51, 0.5);
  482. border-radius: 0px 0px 4px 4px;
  483. }
  484. .inputs-menu {
  485. width: 100%;
  486. position: absolute;
  487. height: 478px;
  488. display: none;
  489. color: #000;
  490. }
  491. .inputs-menu.active {
  492. display: block;
  493. }
  494. .inputs-tab.close {
  495. float: right;
  496. margin-right: 5px;
  497. margin-top: -5px;
  498. border-radius: 50%;
  499. }
  500. #mainui-ads {
  501. height: 400px !important;
  502. }
  503. #botsInfo > a, #botsAuthor > a {
  504. color: #3894F8;
  505. text-decoration: none;
  506. }
  507. #botsAuthor {
  508. margin-top: -15px;
  509. letter-spacing: 1px;
  510. }
  511. #statusText, #aiText {
  512. font-weight: bold;
  513. }
  514. #userStatus, #botsAI {
  515. color: #DA0A00;
  516. }
  517. #botsName, #botsAmount, #botsRemoteIP {
  518. margin-top: 5px;
  519. width: 144px;
  520. border: 1px solid black;
  521. border-radius: 5px;
  522. padding: 8px;
  523. font-size: 14.5px;
  524. outline: none;
  525. }
  526. #botsName:focus, #botsAmount:focus {
  527. border-color: #7D7D7D;
  528. }
  529. #connect, #startBots, #stopBots, #botsPanel {
  530. color: white;
  531. border: none;
  532. border-radius: 5px;
  533. padding: 7px;
  534. width: 160px;
  535. font-size: 18px;
  536. outline: none;
  537. margin-top: 5px;
  538. letter-spacing: 1px;
  539. }
  540. #connect {
  541. display: inline;
  542. margin-left: 5px;
  543. background-color: #0074C0;
  544. }
  545. #startBots {
  546. display: inline;
  547. background-color: #00C02E;
  548. }
  549. #botsPanel {
  550. display: inline;
  551. background-color: #222;
  552. }
  553. #stopBots {
  554. display: none;
  555. background-color: #DA0A00;
  556. }
  557. #connect:active {
  558. background-color: #004E82;
  559. }
  560. #startBots:active {
  561. background-color: #009A25;
  562. }
  563. #stopBots:active {
  564. background-color: #9A1B00;
  565. }
  566. </style>
  567. `
  568. }
  569. function setGUIEvents() {
  570. $("#botsPanel").click(() => {
  571. $("#inputs").show();
  572. });
  573. $(".close").click(() => {
  574. $("#inputs").hide();
  575. });
  576. $("#hotkeysbutton").click(() => {
  577. $("#settings").hide();
  578. $("#hotkeys").show();
  579. });
  580. $("#settingsbutton").click(() => {
  581. $("#hotkeys").hide();
  582. $("#settings").show();
  583. });
  584. document.getElementById('botsAmount').addEventListener('keypress', e => {
  585. e.preventDefault()
  586. })
  587. document.getElementById('botsName').addEventListener('change', function() {
  588. window.bots.name = this.value
  589. localStorage.setItem('localStoredBotsName', window.bots.name)
  590. })
  591. document.getElementById('botsAmount').addEventListener('change', function() {
  592. window.bots.amount = Number(this.value)
  593. localStorage.setItem('localStoredBotsAmount', window.bots.amount)
  594. })
  595. document.getElementById('connect').addEventListener('click', () => {
  596. if (!window.connection.ws || window.connection.ws.readyState !== WebSocket.OPEN) window.connection.connect()
  597. })
  598. document.getElementById('startBots').addEventListener('click', () => {
  599. if (window.game.url && window.game.protocolVersion && window.game.clientVersion && !window.user.startedBots) {
  600. this.partytoken = MC.getPartyToken()
  601. if (this.partytoken!="" && this.partytoken!=null){
  602. if (window.bots.name && window.bots.amount && !document.getElementById('socialLoginContainer')) window.connection.send(window.buffers.startBots(window.game.url.split('?')[0], window.game.protocolVersion, window.game.clientVersion, window.user.isAlive, window.unescape(window.encodeURIComponent(window.bots.name)), window.bots.amount))
  603. //if (window.bots.name && window.bots.amount && !document.getElementById('socialLoginContainer')) window.connection.send(window.buffers.startBots(window.game.url.split('?')[0], window.game.protocolVersion, window.game.clientVersion, window.user.isAlive, window.bots.name, window.bots.amount))
  604. else alert('Bots name and amount are required before starting the bots, also you need to be logged in to your agar.io account in order to start the bots')
  605. }
  606. else{
  607. alert('Bots are designed for party')
  608. }
  609. }
  610. })
  611. document.getElementById('stopBots').addEventListener('click', () => {
  612. if (window.user.startedBots) window.connection.send(new Uint8Array([1]).buffer)
  613. })
  614. document.getElementById('botsRemoteIP').addEventListener('change', function(){
  615. window.bots.remoteIP = this.value
  616. localStorage.setItem('localstoredBotsRemoteIP', window.bots.remoteIP)
  617. window.SERVER_HOST = window.bots.remoteIP
  618. })
  619. }
  620. function loadUI(){
  621. $('body').append(`
  622. <div id="botClient" style="position: absolute; top: 92%; left: 85%; padding: 0px 8px; font-family: Tahoma; color: rgb(255, 255, 255); z-index: 9999; border-radius: 5px; min-height: 16px; min-width: 200px; background-color: rgba(2, 0, 0, 0.4);">
  623. <div><b>Bot Count</b>: <span id="botCount" class="label label-info pull-right">Waiting</span></div>
  624. <b><div><b>ServerSlots</b>: <span id="slots" class="label label-info pull-right">Waiting</span></div>
  625. </div>`);
  626. }
  627. WebSocket.prototype.storedSend = WebSocket.prototype.send
  628. WebSocket.prototype.send = function(buffer) {
  629. this.storedSend(buffer)
  630. const dataView = new DataView(new Uint8Array(buffer).buffer)
  631. if (!window.game.protocolVersion && dataView.getUint8(0) === 254) window.game.protocolVersion = dataView.getUint32(1, true)
  632. else if (!window.game.clientVersion && dataView.getUint8(0) === 255) window.game.clientVersion = dataView.getUint32(1, true)
  633. }
  634. new MutationObserver(mutations => {
  635. mutations.forEach(({
  636. addedNodes
  637. }) => {
  638. addedNodes.forEach(node => {
  639. if (node.nodeType === 1 && node.tagName === 'SCRIPT' && node.src && node.src.includes('agario.core.js')) {
  640. node.type = 'javascript/blocked'
  641. node.parentElement.removeChild(node)
  642. fetch(node.src)
  643. .then(res => res.text())
  644. .then(core => {
  645. Function(modifyCore(core))()
  646. setKeysEvents()
  647. setTimeout(() => {
  648. setGUI()
  649. setGUIStyle()
  650. setGUIEvents()
  651. loadUI()
  652. }, 3500)
  653. })
  654. }
  655. })
  656. })
  657. }).observe(document.documentElement, {
  658. childList: true,
  659. subtree: true
  660. })

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址