The Diep.io Custom AutoBuilder. Beta

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

As of 2025-01-20. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         The Diep.io Custom AutoBuilder. Beta
// @namespace    http://tampermonkey.net/
// @version      9.3
// @homepage     https://greatest.deepsurf.us/scripts/416440
// @description  NEW! custom builds update! Your builds will save now! This is still in beta!
// @author       -{Abyss⌬}-ora
// @match        https://diep.io/*
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==


(function () {
    "use strict";

    const hoverMenu = document.createElement("div");
    hoverMenu.id = "myhover";
    hoverMenu.className = "hover";

    const modMenu = document.createElement("a");
    modMenu.id = "modtab";

    const menuHeader = document.createElement("h1");
    menuHeader.textContent = "-{Abyss⌬}-ora's Mod Menu beta";
    modMenu.appendChild(menuHeader);

    const style = document.createElement("style");
    style.type = "text/css";
    style.textContent = `
        #myhover a {
            z-index: 999;
            position: absolute;
            top: 300px;
            right: -260px;
            transition: 0.3s;
            width: 250px;
            padding: 15px;
            background-image: url("https://media.tenor.com/images/f3f5354b7c304bc61882dbb1183885e7/tenor.gif");
            background-color: #555;
            text-decoration: none;
            font-size: 10px;
            font-family: 'Monoton', cursive;
            text-shadow: 1px 1px #000, 2px 2px #555;
            color: white;
            border: double thick white;
            border-radius: 20px;
        }
        #myhover a:hover {
            right: 0;
        }
        .button {
            display: block;
            margin: 5px auto;
            width: 90%;
            text-align: center;
            font-size: 18px;
            font-family: 'Jersey 10', sans-serif;
            color: black;
            background-color: white;
            border-radius: 5px;
            transition: 0.4s;
            cursor: pointer;
        }
        .button:hover {
            transform: translateX(-10px);
        }
        #userInput {
            margin: 5px auto;
            width: 90%;
            padding: 8px;
            font-family: 'Monoton', cursive;
            text-align: center;
        }
        #specialButton {
            display: block;
            margin: 5px auto;
            width: 90%;
            text-align: center;
            font-size: 18px;
            font-family: 'Jersey 10', sans-serif;
            color: white;
            background-color: black;  /* updated */
            border-radius: 5px;
            border-color: white;
            transition: 0.4s;
            cursor: pointer;
            opacity: 0.8;  /* updated */
        }
        #specialButton:hover {
            color: black;
            background-color: darkgray;
            transform: translateX(-10px);
        }
        .popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 300px;
            background-image: url("https://media.tenor.com/images/f3f5354b7c304bc61882dbb1183885e7/tenor.gif");
            background-color: white;
            border: double thick white;
            border-radius: 10px;
            padding: 20px;
            z-index: 1000;
        }
        .attribute {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }
        .attribute div {
            width: 30px;
            height: 30px;
            border: 1px solid #000;
            margin: 0;
        }
        .attribute button {
            background-color: gray;
            border: none;
            color: white;
            font-size: 20px;
            cursor: pointer;
            width: 30px;
            height: 30px;
            margin: 0;
        }
        #pointsCounter {
            text-align: center;
            font-size: 16px;
            margin-bottom: 10px;
        }
        #createBuildButton {
            display: block;
            margin: 20px auto 0 auto;
            width: 80%;
            text-align: center;
            font-size: 18px;
            font-family: 'Jersey 10', sans-serif;
            color: black;
            background-color: white;
            border-radius: 5px;
            border: 2px solid black;
            cursor: pointer;
            padding: 10px;
        }
        #createBuildButton:hover {
            background-color: gray;
            color: white;
        }
        #codeString {
            text-align: center;
            font-size: 18px;
            margin: 10px 0;
        }
        .remove-button {
            background-color: gray;
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
            width: 30px;
            height: 30px;
            margin-right: 5px;
            transition: background-color 0.3s;
        }
        .remove-button:hover {
            background-color: red;
        }
        .close-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 30px;
            height: 30px;
            background-color: gray;
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
            line-height: 30px;
            text-align: center;
            transition: background-color 0.3s;
            opacity: 0.8;
        }
        .close-btn:hover {
            background-color: red;
        }
    `;
    document.head.appendChild(style);

    const userInput = document.createElement("input");
    userInput.id = "userInput";
    userInput.type = "text";
    userInput.placeholder = "Enter Username For Quick Spawn";
    userInput.value = localStorage.getItem("name") || "";

    modMenu.appendChild(userInput);

    const buttons = [

    ];

    buttons.forEach((buttonData) => {
        const buttonContainer = document.createElement("div");
        buttonContainer.style.display = "flex";
        buttonContainer.style.alignItems = "center";
        buttonContainer.style.justifyContent = "center";

        const removeButton = document.createElement("button");
        removeButton.className = "remove-button";
        removeButton.textContent = "[-]";
        removeButton.onclick = () => {
            buttonContainer.remove();
            const updatedButtons = JSON.parse(localStorage.getItem("savedButtons")).filter(b => b.name !== buttonData.name); localStorage.setItem("savedButtons", JSON.stringify(updatedButtons));
        };
        buttonContainer.appendChild(removeButton);

        const button = document.createElement("button");
        button.className = "button";
        button.textContent = buttonData.name;
        button.style.backgroundColor = buttonData.color;
        button.onclick = () => {
            const spawnName = userInput.value.trim();
            window.input.execute(`game_spawn ${spawnName}`);
            window.input.execute(`game_stats_build ${buttonData.cmd}`);
        };
        buttonContainer.appendChild(button);

        modMenu.appendChild(buttonContainer);
    });

    const specialButton = document.createElement("button");
    specialButton.id = "specialButton";
    specialButton.textContent = "[+]";

    specialButton.onclick = () => {
        const popup = document.createElement("div");
        popup.className = "popup";

        const closeButton = document.createElement("button");
        closeButton.className = "close-btn";
        closeButton.textContent = "X";
        closeButton.onclick = () => {
            document.body.removeChild(popup);
        };
        popup.appendChild(closeButton);

        const buildNameInput = document.createElement("input");
        buildNameInput.type = "text";
        buildNameInput.placeholder = "Build Name";
        buildNameInput.style.display = "block";
        buildNameInput.style.width = "80%";
        buildNameInput.style.margin = "0 auto 10px auto";
        popup.appendChild(buildNameInput);

        const pointsCounter = document.createElement("div");
        pointsCounter.id = "pointsCounter";
        pointsCounter.textContent = "Points: 33";
        popup.appendChild(pointsCounter);

        const codeString = document.createElement("div");
        codeString.id = "codeString";
        codeString.textContent = "Code: 0";
        popup.appendChild(codeString);

        let totalPoints = 33;
        let code = "";

        const attributes = [
            { name: "Health Regen", color: "rgb(232, 188, 157)" },
            { name: "Max Health", color: "rgb(230, 128, 234)" },
            { name: "Body Damage", color: "rgb(165, 128, 234)" },
            { name: "Bullet Speed", color: "rgb(128, 162, 234)" },
            { name: "Bullet Penetration", color: "rgb(234, 215, 128)" },
            { name: "Bullet Damage", color: "rgb(234, 128, 128)" },
            { name: "Reload", color: "rgb(164, 234, 128)" },
            { name: "Movement Speed", color: "rgb(128, 234, 230)" },
        ];

        attributes.forEach((attribute, index) => {
            const attributeRow = document.createElement("div");
            attributeRow.className = "attribute";

            const minusButton = document.createElement("button");
            minusButton.textContent = "-";
            minusButton.onclick = () => {
                const coloredSquares = Array.from(attributeRow.children).filter(child => child.style.backgroundColor === attribute.color);
                if (coloredSquares.length > 0 && totalPoints < 33) {
                    coloredSquares[coloredSquares.length - 1].style.backgroundColor = "gray";
                    totalPoints++;
                    pointsCounter.textContent = `Points: ${totalPoints}`;
                    code = code.slice(0, -1);
                    codeString.textContent = `Code: ${code}`;
                }
            };
            attributeRow.appendChild(minusButton);

            for (let i = 0; i < 7; i++) {
                const colorDiv = document.createElement("div");
                colorDiv.style.backgroundColor = "gray";
                attributeRow.appendChild(colorDiv);
            }

            const plusButton = document.createElement("button");
            plusButton.textContent = "+";
            plusButton.onclick = () => {
                const graySquares = Array.from(attributeRow.children).filter(child => child.style.backgroundColor === "gray");
                if (graySquares.length > 0 && totalPoints > 0) {
                    graySquares[0].style.backgroundColor = attribute.color;
                    totalPoints--;
                    pointsCounter.textContent = `Points: ${totalPoints}`;
                    code += (index + 1).toString();
                    codeString.textContent = `Code: ${code}`;
                }
            };
            attributeRow.appendChild(plusButton);

            popup.appendChild(attributeRow);
        });

        const createBuildButton = document.createElement("button");
        createBuildButton.id = "createBuildButton";
        createBuildButton.textContent = "Create Build";
        createBuildButton.onclick = () => {
            const buildName = buildNameInput.value.trim();
            if (buildName === "") {
                alert("Please enter a build name.");
                return;
            }

            let savedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
            savedButtons.push({ name: buildName, color: "#C0C0C0", cmd: code });
            localStorage.setItem("savedButtons", JSON.stringify(savedButtons));

            const buttonContainer = document.createElement("div");
            buttonContainer.style.display = "flex";
            buttonContainer.style.alignItems = "center";
            buttonContainer.style.justifyContent = "center";

            const removeButton = document.createElement("button");
            removeButton.className = "remove-button";
            removeButton.textContent = "[-]";
            removeButton.onclick = () => {
                buttonContainer.remove();
                const updatedButtons = JSON.parse(localStorage.getItem("savedButtons")).filter(b => b.name !== buildName);
                localStorage.setItem("savedButtons", JSON.stringify(updatedButtons));
            };
            buttonContainer.appendChild(removeButton);

            const newButton = document.createElement("button");
            newButton.className = "button";
            newButton.textContent = buildName;
            newButton.style.backgroundColor = "#C0C0C0";
            newButton.onclick = () => {
                const spawnName = userInput.value.trim();
                window.input.execute(`game_spawn ${spawnName}`);
                window.input.execute(`game_stats_build ${code}`);
            };
            buttonContainer.appendChild(newButton);

            modMenu.insertBefore(buttonContainer, specialButton);

            document.body.removeChild(popup);
        };
        popup.appendChild(createBuildButton);

        document.body.appendChild(popup);
    };

    modMenu.appendChild(specialButton);

    hoverMenu.appendChild(modMenu);
    document.body.appendChild(hoverMenu);

    document.addEventListener("keydown", (event) => {
        if (event.key === "r" || event.key === "R") {
            const hoverMenu = document.getElementById("myhover");
            if (hoverMenu) {
                hoverMenu.style.display = hoverMenu.style.display === "none" ? "block" : "none";
            }
        }
    });

    window.onload = () => {
        const savedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
        const removedDefaults = JSON.parse(localStorage.getItem("removedDefaults")) || [];

        const defaultButtons = [
            { name: "L3mon", color: "#FFFFFF", cmd: "656565656565654848748487484874877" },
            { name: "Factory", color: "#F0F0F0", cmd: "567456745678567456745678567488888" },
            { name: "OverLord 2.0", color: "#E0E0E0", cmd: "456745674567456745674567456788888" },
            { name: "OverLord", color: "#D0D0D0", cmd: "555666555566664444444888888822111" },
            { name: "Juggernaut", color: "#C0C0C0", cmd: "213121312138238238883288327777777" },
            { name: "Annihilator", color: "#B0B0B0", cmd: "000000000011111111222222223333333" },
            { name: "Shadow", color: "#A0A0A0", cmd: "999999999999999999888888887777777" },
            { name: "Nemesis", color: "#909090", cmd: "666666666666666555555554444444444" },
            { name: "Warlord", color: "#808080", cmd: "123456789012345678901234567890123" },
            { name: "Phantom", color: "#707070", cmd: "543210987654321098765432109876543" }
        ];

        const allButtons = [...defaultButtons, ...savedButtons.filter(saved => !defaultButtons.some(defaultButton => defaultButton.name === saved.name))];

        const finalButtons = allButtons.filter(buttonData => !removedDefaults.includes(buttonData.name));

        finalButtons.forEach((buttonData) => {
            const buttonContainer = document.createElement("div");
            buttonContainer.style.display = "flex";
            buttonContainer.style.alignItems = "center";
            buttonContainer.style.justifyContent = "center";

            const removeButton = document.createElement("button");
            removeButton.className = "remove-button";
            removeButton.textContent = "[-]";
            removeButton.onclick = () => {
                buttonContainer.remove();

                const updatedButtons = JSON.parse(localStorage.getItem("savedButtons")) || [];
                const newSavedButtons = updatedButtons.filter(b => b.name !== buttonData.name);
                localStorage.setItem("savedButtons", JSON.stringify(newSavedButtons));

                const updatedRemovedDefaults = JSON.parse(localStorage.getItem("removedDefaults")) || [];
                if (!updatedRemovedDefaults.includes(buttonData.name)) {
                    updatedRemovedDefaults.push(buttonData.name);
                    localStorage.setItem("removedDefaults", JSON.stringify(updatedRemovedDefaults));
                }
            };
            buttonContainer.appendChild(removeButton);

            const button = document.createElement("button");
            button.className = "button";
            button.textContent = buttonData.name;
            button.style.backgroundColor = buttonData.color;
            button.onclick = () => {
                const spawnName = userInput.value.trim();
                window.input.execute(`game_spawn ${spawnName}`);
                window.input.execute(`game_stats_build ${buttonData.cmd}`);
            };
            buttonContainer.appendChild(button);

            modMenu.insertBefore(buttonContainer, specialButton);
        });
    };

    document.getElementById("userInput").addEventListener("input", (event) => { localStorage.setItem("quickSpawnUsername", event.target.value); });

})();