The Diep.io Custom AutoBuilder. Beta

NEW! custom builds update! Your builds will save now! This is still in beta!

Fra 22.01.2025. Se den seneste versjonen.

  1. // ==UserScript==
  2. // @name The Diep.io Custom AutoBuilder. Beta
  3. // @namespace http://tampermonkey.net/
  4. // @version 9.4
  5. // @homepage https://greatest.deepsurf.us/scripts/416440
  6. // @description NEW! custom builds update! Your builds will save now! This is still in beta!
  7. // @author -{Abyss⌬}-ora
  8. // @match https://diep.io/*
  9. // @grant none
  10. // @license GNU GPLv3
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. "use strict";
  15.  
  16. const hoverMenu = document.createElement("div");
  17. hoverMenu.id = "myhover";
  18. hoverMenu.className = "hover";
  19.  
  20. const modMenu = document.createElement("a");
  21. modMenu.id = "modtab";
  22.  
  23. const menuHeader = document.createElement("h1");
  24. menuHeader.textContent = "-{Abyss⌬}-ora's Mod Menu beta";
  25. modMenu.appendChild(menuHeader);
  26.  
  27. const topRightButton = document.createElement("button");
  28. topRightButton.id = "topRightButton";
  29. topRightButton.textContent = "↻";
  30.  
  31. const style = document.createElement("style");
  32. style.type = "text/css";
  33. style.textContent = `
  34. #myhover a {
  35. z-index: 999;
  36. position: absolute;
  37. top: 300px;
  38. right: -260px;
  39. transition: 0.3s;
  40. width: 250px;
  41. padding: 15px;
  42. background-image: url("https://media.tenor.com/images/f3f5354b7c304bc61882dbb1183885e7/tenor.gif");
  43. background-color: #555;
  44. text-decoration: none;
  45. font-size: 10px;
  46. font-family: 'Monoton', cursive;
  47. text-shadow: 1px 1px #000, 2px 2px #555;
  48. color: white;
  49. border: double thick white;
  50. border-radius: 20px;
  51. }
  52. #myhover a:hover {
  53. right: 0;
  54. }
  55. .button {
  56. display: block;
  57. margin: 5px auto;
  58. width: 90%;
  59. text-align: center;
  60. font-size: 18px;
  61. font-family: 'Jersey 10', sans-serif;
  62. color: black;
  63. background-color: white;
  64. border-radius: 5px;
  65. transition: 0.4s;
  66. cursor: pointer;
  67. }
  68. .button:hover {
  69. transform: translateX(-10px);
  70. }
  71. #userInput {
  72. margin: 5px auto;
  73. width: 90%;
  74. padding: 8px;
  75. font-family: 'Monoton', cursive;
  76. text-align: center;
  77. }
  78. #specialButton {
  79. display: block;
  80. margin: 5px auto;
  81. width: 90%;
  82. text-align: center;
  83. font-size: 18px;
  84. font-family: 'Jersey 10', sans-serif;
  85. color: white;
  86. background-color: black;
  87. border-radius: 5px;
  88. border-color: white;
  89. transition: 0.4s;
  90. cursor: pointer;
  91. opacity: 0.8;
  92. }
  93. #specialButton:hover {
  94. color: black;
  95. background-color: darkgray;
  96. transform: translateX(-10px);
  97. }
  98. .popup {
  99. position: fixed;
  100. top: 50%;
  101. left: 50%;
  102. transform: translate(-50%, -50%);
  103. width: 300px;
  104. background-image: url("https://media.tenor.com/images/f3f5354b7c304bc61882dbb1183885e7/tenor.gif");
  105. background-color: white;
  106. border: double thick white;
  107. border-radius: 10px;
  108. padding: 20px;
  109. z-index: 1000;
  110. text-shadow: 1px 1px #000, 2px 2px #555;
  111. }
  112. .attribute {
  113. display: flex;
  114. align-items: center;
  115. margin-bottom: 10px;
  116. }
  117. .attribute div {
  118. width: 30px;
  119. height: 30px;
  120. border: 1px solid #000;
  121. margin: 0;
  122. }
  123. .attribute button {
  124. background-color: gray;
  125. border: none;
  126. color: white;
  127. font-size: 20px;
  128. cursor: pointer;
  129. width: 30px;
  130. height: 30px;
  131. margin: 0;
  132. }
  133. #pointsCounter {
  134. text-align: center;
  135. font-size: 16px;
  136. margin-bottom: 10px;
  137. }
  138. #createBuildButton {
  139. display: block;
  140. margin: 20px auto 0 auto;
  141. width: 80%;
  142. text-align: center;
  143. font-size: 18px;
  144. font-family: 'Jersey 10', sans-serif;
  145. color: black;
  146. background-color: white;
  147. border-radius: 5px;
  148. border: 2px solid black;
  149. cursor: pointer;
  150. padding: 10px;
  151. }
  152. #createBuildButton:hover {
  153. background-color: gray;
  154. color: white;
  155. }
  156. #codeString {
  157. text-align: center;
  158. font-size: 18px;
  159. margin: 10px 0;
  160. }
  161. .remove-button {
  162. background-color: gray;
  163. border: none;
  164. color: white;
  165. font-size: 18px;
  166. cursor: pointer;
  167. width: 30px;
  168. height: 30px;
  169. margin-right: 5px;
  170. transition: background-color 0.3s;
  171. }
  172. .remove-button:hover {
  173. background-color: red;
  174. }
  175. .close-btn {
  176. position: absolute;
  177. top: 5px;
  178. right: 5px;
  179. width: 30px;
  180. height: 30px;
  181. background-color: black;
  182. color: white;
  183. border: none;
  184. border-radius: 10%;
  185. cursor: pointer;
  186. font-size: 18px;
  187. line-height: 30px;
  188. text-align: center;
  189. transition: background-color 0.3s;
  190. opacity: 0.8;
  191. }
  192. .close-btn:hover {
  193. background-color: red;
  194. }
  195. #topRightButton {
  196. position: absolute;
  197. top: 10px;
  198. right: 10px;
  199. width: 30px;
  200. height: 30px;
  201. background-color: black;
  202. color: white;
  203. border: none;
  204. border-radius: 10%;
  205. cursor: pointer;
  206. font-size: 18px;
  207. display: flex;
  208. justify-content: center;
  209. align-items: center;
  210. transition: background-color 0.3s;
  211. z-index: 1001;
  212. opacity: 0.8;
  213. }
  214. #topRightButton:hover {
  215. color: red;
  216. }
  217. #buildButtonsContainer {
  218. max-height: 400px;
  219. overflow-y: scroll;
  220. margin-left: 5px;
  221. }
  222. #buildButtonsContainer {
  223. -ms-overflow-style: none;
  224. scrollbar-width: none;
  225. }
  226. ::-webkit-scrollbar {
  227. width: 10px;
  228. }
  229. ::-webkit-scrollbar-track {
  230. background: #f1f1f1;
  231. border-radius: 10px;
  232. }
  233. ::-webkit-scrollbar-thumb {
  234. background: #888;
  235. border-radius: 10px;
  236. }
  237. ::-webkit-scrollbar-thumb:hover {
  238. background: #555;
  239. }
  240. `;
  241. document.head.appendChild(style);
  242.  
  243. const userInput = document.createElement("input");
  244. userInput.id = "userInput";
  245. userInput.type = "text";
  246. userInput.placeholder = "Enter Username For Quick Spawn";
  247. userInput.value = localStorage.getItem("quickSpawnUsername") || "";
  248. modMenu.appendChild(userInput);
  249.  
  250. userInput.addEventListener("input", (event) => {
  251. localStorage.setItem("quickSpawnUsername", event.target.value);
  252. });
  253.  
  254. const buttons = [];
  255.  
  256. buttons.forEach((buttonData) => {
  257. const buttonContainer = document.createElement("div");
  258. buttonContainer.style.display = "flex";
  259. buttonContainer.style.alignItems = "center";
  260. buttonContainer.style.justifyContent = "center";
  261.  
  262. const removeButton = document.createElement("button");
  263. removeButton.className = "remove-button";
  264. removeButton.textContent = "[-]";
  265. removeButton.onclick = () => {
  266. buttonContainer.remove();
  267. const updatedButtons = JSON.parse(localStorage.getItem("savedButtons")).filter(b => b.name !== buttonData.name);
  268. localStorage.setItem("savedButtons", JSON.stringify(updatedButtons));
  269.  
  270. const updatedRemovedDefaults = JSON.parse(localStorage.getItem("removedDefaults")) || [];
  271. updatedRemovedDefaults = updatedRemovedDefaults.filter(b => b !== buttonData.name);
  272. localStorage.setItem("removedDefaults", JSON.stringify(updatedRemovedDefaults));
  273. };
  274. buttonContainer.appendChild(removeButton);
  275.  
  276. const button = document.createElement("button");
  277. button.className = "button";
  278. button.textContent = buttonData.name;
  279. button.style.backgroundColor = buttonData.color;
  280. button.onclick = () => {
  281. const spawnName = userInput.value.trim();
  282. window.input.execute(`game_spawn ${spawnName}`);
  283. window.input.execute(`game_stats_build ${buttonData.cmd}`);
  284. };
  285. buttonContainer.appendChild(button);
  286.  
  287. modMenu.appendChild(buttonContainer);
  288. });
  289.  
  290. const specialButton = document.createElement("button");
  291. specialButton.id = "specialButton";
  292. specialButton.textContent = "[+]";
  293.  
  294. specialButton.onclick = () => {
  295. const popup = document.createElement("div");
  296. popup.className = "popup";
  297.  
  298. const closeButton = document.createElement("button");
  299. closeButton.className = "close-btn";
  300. closeButton.textContent = "X";
  301. closeButton.onclick = () => {
  302. document.body.removeChild(popup);
  303. };
  304. popup.appendChild(closeButton);
  305.  
  306. const buildNameInput = document.createElement("input");
  307. buildNameInput.type = "text";
  308. buildNameInput.placeholder = "Build Name";
  309. buildNameInput.style.display = "block";
  310. buildNameInput.style.width = "80%";
  311. buildNameInput.style.margin = "0 auto 10px auto";
  312. popup.appendChild(buildNameInput);
  313.  
  314. const pointsCounter = document.createElement("div");
  315. pointsCounter.id = "pointsCounter";
  316. pointsCounter.textContent = "Points: 33";
  317. popup.appendChild(pointsCounter);
  318.  
  319. const codeString = document.createElement("div");
  320. codeString.id = "codeString";
  321. codeString.textContent = "Code: 0";
  322. popup.appendChild(codeString);
  323.  
  324. let totalPoints = 33;
  325. let code = "";
  326.  
  327. const attributes = [
  328. { name: "Health Regen", color: "rgb(232, 188, 157)" },
  329. { name: "Max Health", color: "rgb(230, 128, 234)" },
  330. { name: "Body Damage", color: "rgb(165, 128, 234)" },
  331. { name: "Bullet Speed", color: "rgb(128, 162, 234)" },
  332. { name: "Bullet Penetration", color: "rgb(234, 215, 128)" },
  333. { name: "Bullet Damage", color: "rgb(234, 128, 128)" },
  334. { name: "Reload", color: "rgb(164, 234, 128)" },
  335. { name: "Movement Speed", color: "rgb(128, 234, 230)" },
  336. ];
  337.  
  338. attributes.forEach((attribute, index) => {
  339. const attributeRow = document.createElement("div");
  340. attributeRow.className = "attribute";
  341.  
  342. const minusButton = document.createElement("button");
  343. minusButton.textContent = "-";
  344. minusButton.onclick = () => {
  345. const coloredSquares = Array.from(attributeRow.children).filter(child => child.style.backgroundColor === attribute.color);
  346. if (coloredSquares.length > 0 && totalPoints < 33) {
  347. coloredSquares[coloredSquares.length - 1].style.backgroundColor = "gray";
  348. totalPoints++;
  349. pointsCounter.textContent = `Points: ${totalPoints}`;
  350. code = code.slice(0, -1);
  351. codeString.textContent = `Code: ${code}`;
  352. }
  353. };
  354. attributeRow.appendChild(minusButton);
  355.  
  356. for (let i = 0; i < 7; i++) {
  357. const colorDiv = document.createElement("div");
  358. colorDiv.style.backgroundColor = "gray";
  359. attributeRow.appendChild(colorDiv);
  360. }
  361.  
  362. const plusButton = document.createElement("button");
  363. plusButton.textContent = "+";
  364. plusButton.onclick = () => {
  365. const graySquares = Array.from(attributeRow.children).filter(child => child.style.backgroundColor === "gray");
  366. if (graySquares.length > 0 && totalPoints > 0) {
  367. graySquares[0].style.backgroundColor = attribute.color;
  368. totalPoints--;
  369. pointsCounter.textContent = `Points: ${totalPoints}`;
  370. code += (index + 1).toString();
  371. codeString.textContent = `Code: ${code}`;
  372. }
  373. };
  374. attributeRow.appendChild(plusButton);
  375.  
  376. popup.appendChild(attributeRow);
  377. });
  378.  
  379. const createBuildButton = document.createElement("button");
  380. createBuildButton.id = "createBuildButton";
  381. createBuildButton.textContent = "Create Build";
  382. createBuildButton.onclick = () => {
  383. const buildName = buildNameInput.value.trim();
  384. if (buildName === "") {
  385. alert("Please enter a build name.");
  386. return;
  387. }
  388.  
  389. let savedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
  390. savedButtons.push({ name: buildName, color: "#C0C0C0", cmd: code });
  391. localStorage.setItem("savedButtons", JSON.stringify(savedButtons));
  392.  
  393. const buttonContainer = document.createElement("div");
  394. buttonContainer.style.display = "flex";
  395. buttonContainer.style.alignItems = "center";
  396. buttonContainer.style.justifyContent = "center";
  397.  
  398. const removeButton = document.createElement("button");
  399. removeButton.className = "remove-button";
  400. removeButton.textContent = "[-]";
  401. removeButton.onclick = () => {
  402. buttonContainer.remove();
  403. const updatedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
  404. let newSavedButtons = updatedButtons.filter(b => b.name !== buildName);
  405. localStorage.setItem("savedButtons", JSON.stringify(newSavedButtons));
  406.  
  407. let updatedRemovedDefaults = JSON.parse(localStorage.getItem("removedDefaults")) || [];
  408. updatedRemovedDefaults = updatedRemovedDefaults.filter(b => b !== buildName);
  409. localStorage.setItem("removedDefaults", JSON.stringify(updatedRemovedDefaults));
  410. };
  411. buttonContainer.appendChild(removeButton);
  412.  
  413. const newButton = document.createElement("button");
  414. newButton.className = "button";
  415. newButton.textContent = buildName;
  416. newButton.style.backgroundColor = "#C0C0C0";
  417. newButton.onclick = () => {
  418. const spawnName = userInput.value.trim();
  419. window.input.execute(`game_spawn ${spawnName}`);
  420. window.input.execute(`game_stats_build ${code}`);
  421. };
  422. buttonContainer.appendChild(newButton);
  423.  
  424. buildButtonsContainer.appendChild(buttonContainer);
  425.  
  426. document.body.removeChild(popup);
  427. };
  428. popup.appendChild(createBuildButton);
  429.  
  430. document.body.appendChild(popup);
  431. };
  432.  
  433. modMenu.appendChild(specialButton);
  434. modMenu.appendChild(topRightButton);
  435. hoverMenu.appendChild(modMenu);
  436. document.body.appendChild(hoverMenu);
  437.  
  438. document.addEventListener("keydown", (event) => {
  439. if (event.key === "r" || event.key === "R") {
  440. const hoverMenu = document.getElementById("myhover");
  441. if (hoverMenu) {
  442. hoverMenu.style.display = hoverMenu.style.display === "none" ? "block" : "none";
  443. }
  444. }
  445. });
  446.  
  447. window.onload = () => {
  448. const userInput = document.getElementById("userInput");
  449. const specialButton = document.getElementById("specialButton");
  450. const modMenu = document.getElementById("modtab");
  451. const topRightButton = document.getElementById("topRightButton");
  452.  
  453. const savedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
  454. const removedDefaults = JSON.parse(localStorage.getItem("removedDefaults")) || [];
  455.  
  456. const defaultButtons = [
  457. { "name": "L3mon", "color": "#FFFFFF", "cmd": "656565656565654848748487484874877" },
  458. { "name": "Factory", "color": "#FFFFFF", "cmd": "567456745678567456745678567488888" },
  459. { "name": "OverLord2.0", "color": "#FFFFFF", "cmd": "456745674567456745674567456788888" },
  460. { "name": "OverLord", "color": "#FFFFFF", "cmd": "555666555566664444444888888822111" },
  461. { "name": "Juggernaut", "color": "#FFFFFF", "cmd": "213121312138238238883288327777777" },
  462. { "name": "SmasherPacifist", "color": "#FFFFFF", "cmd": "7654765476547654765476547654128128128312812812812831281281283" },
  463. { "name": "SmasherAttacker", "color": "#FFFFFF", "cmd": "7654765476547654765476547654111823823823823823823823823823823" },
  464. { "name": "SturdyDestroyer", "color": "#FFFFFF", "cmd": "456456456456456456456123123123123" },
  465. { "name": "Aggressor", "color": "#FFFFFF", "cmd": "456745674567456745674567456722111" },
  466. { "name": "SturdyAggressor", "color": "#FFFFFF", "cmd": "567856785678567856785678567822111" },
  467. { "name": "SturdyTriangle", "color": "#FFFFFF", "cmd": "567567567567567567567123123123123" },
  468. { "name": "Sniper", "color": "#FFFFFF", "cmd": "564456445644564815681568156818188" },
  469. { "name": "Trapper", "color": "#FFFFFF", "cmd": "567567485675674856756748567484848" },
  470. { "name": "Semi/Ram/Booster", "color": "#FFFFFF", "cmd": "567823567823148148567823567882314" },
  471. { "name": "anti-ram", "color": "#FFFFFF", "cmd": "234234562345623456234562345623456" },
  472. { "name": "pentrat/anti-ram", "color": "#FFFFFF", "cmd": "345345263452634526345263452634526" },
  473. { "name": "Anni/hybrid", "color": "#FFFFFF", "cmd": "456845684568456845678456782345678" },
  474. { "name": "OL/overseer", "color": "#FFFFFF", "cmd": "456845684568456845683456782345678" }
  475. ];
  476.  
  477. const allButtons = [...defaultButtons, ...savedButtons.filter(saved => !defaultButtons.some(defaultButton => defaultButton.name === saved.name))];
  478. const finalButtons = allButtons.filter(buttonData => !removedDefaults.includes(buttonData.name));
  479.  
  480. const buildButtonsContainer = document.createElement("div");
  481. buildButtonsContainer.id = "buildButtonsContainer";
  482. buildButtonsContainer.style.maxHeight = "400px";
  483. buildButtonsContainer.style.overflowY = "scroll"; // Always enable the scrollbar
  484. buildButtonsContainer.style.color = "black";
  485. modMenu.insertBefore(buildButtonsContainer, specialButton);
  486.  
  487. function createButton(buttonData) {
  488. const buttonContainer = document.createElement("div");
  489. buttonContainer.style.display = "flex";
  490. buttonContainer.style.alignItems = "center";
  491. buttonContainer.style.justifyContent = "center";
  492.  
  493. const removeButton = document.createElement("button");
  494. removeButton.className = "remove-button";
  495. removeButton.textContent = "[-]";
  496. removeButton.onclick = () => {
  497. buttonContainer.remove();
  498.  
  499. let updatedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
  500. let newSavedButtons = updatedButtons.filter(b => b.name !== buttonData.name);
  501. localStorage.setItem("savedButtons", JSON.stringify(newSavedButtons));
  502.  
  503. let updatedRemovedDefaults = JSON.parse(localStorage.getItem("removedDefaults")) || [];
  504. updatedRemovedDefaults.push(buttonData.name);
  505. localStorage.setItem("removedDefaults", JSON.stringify(updatedRemovedDefaults));
  506. };
  507. buttonContainer.appendChild(removeButton);
  508.  
  509. const button = document.createElement("button");
  510. button.className = "button";
  511. button.textContent = buttonData.name;
  512. button.style.backgroundColor = buttonData.color;
  513. button.onclick = () => {
  514. const spawnName = userInput.value.trim();
  515. window.input.execute(`game_spawn ${spawnName}`);
  516. window.input.execute(`game_stats_build ${buttonData.cmd}`);
  517. };
  518. buttonContainer.appendChild(button);
  519.  
  520. buildButtonsContainer.appendChild(buttonContainer);
  521. }
  522.  
  523. finalButtons.forEach(buttonData => createButton(buttonData));
  524.  
  525. const createBuildButton = document.getElementById("createBuildButton");
  526. createBuildButton.onclick = () => {
  527. const buildNameInput = document.getElementById("buildNameInput");
  528. const buildName = buildNameInput.value.trim();
  529. if (buildName === "") {
  530. alert("Please enter a build name.");
  531. return;
  532. }
  533.  
  534. const code = "some_code_here";
  535.  
  536. let savedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
  537. savedButtons.push({ name: buildName, color: "#C0C0C0", cmd: code });
  538. localStorage.setItem("savedButtons", JSON.stringify(savedButtons));
  539.  
  540. createButton({ name: buildName, color: "#C0C0C0", cmd: code });
  541.  
  542. const popup = document.getElementById("popup");
  543. document.body.removeChild(popup);
  544. };
  545. };
  546.  
  547. document.getElementById("userInput").addEventListener("input", (event) => {
  548. localStorage.setItem("quickSpawnUsername", event.target.value);
  549. });
  550.  
  551. topRightButton.addEventListener("click", () => {
  552. const resetPopup = document.createElement("div");
  553. resetPopup.className = "popup";
  554.  
  555. const closeButton = document.createElement("button");
  556. closeButton.className = "close-btn";
  557. closeButton.textContent = "X";
  558. closeButton.onclick = () => {
  559. document.body.removeChild(resetPopup);
  560. };
  561. resetPopup.appendChild(closeButton);
  562.  
  563. const confirmationMessage = document.createElement("div");
  564. confirmationMessage.textContent = "Do you really want to reset to default builds?";
  565. confirmationMessage.style.textAlign = "center";
  566. confirmationMessage.style.marginBottom = "20px";
  567. resetPopup.appendChild(confirmationMessage);
  568.  
  569. const buttonsContainer = document.createElement("div");
  570. buttonsContainer.style.display = "flex";
  571. buttonsContainer.style.justifyContent = "space-between";
  572.  
  573. const noButton = document.createElement("button");
  574. noButton.className = "button";
  575. noButton.textContent = "NO";
  576. noButton.onclick = () => {
  577. document.body.removeChild(resetPopup);
  578. };
  579. buttonsContainer.appendChild(noButton);
  580.  
  581. const yesButton = document.createElement("button");
  582. yesButton.className = "button";
  583. yesButton.textContent = "YES";
  584. yesButton.onclick = () => {
  585. localStorage.removeItem("savedButtons");
  586. localStorage.removeItem("removedDefaults");
  587. location.reload();
  588. };
  589. buttonsContainer.appendChild(yesButton);
  590.  
  591. resetPopup.appendChild(buttonsContainer);
  592. document.body.appendChild(resetPopup);
  593. });
  594.  
  595. })();