Agar.io Skin Changer

Agario Hack

< Feedback on Agar.io Skin Changer

Question/comment

§
Posted: 2018-01-03

Simplification

window.addEventListener("load", () => {
    const skins = "fly spider wasp lizard bat snake fox coyote hunter sumo bear cougar panther lion crocodile shark mammoth raptor t-rex kraken".split(" ");
    const overlay = document.getElementById("overlays");
    for (const skin of skins) {
        window.core.registerSkin(skin, null, `https://configs-web.agario.miniclippt.com/live/v9/1027/${skin.replace(/\b(\w)/g, (a) => a.toUpperCase())}.png`, 1, null);
    }
    let alive = false;
    const pso = window.MC.onPlayerSpawn;
    window.MC.onPlayerSpawn = function() {
        alive = true;
        pso.apply(this, arguments);
    };
    const pdo = window.MC.onPlayerDeath;
    window.MC.onPlayerDeath = function() {
        alive = false;
        pdo.apply(this, arguments);
    };
    window.setInterval(() => {
        console.log("skin change", alive, overlay.style.display == "none");
        if (alive && overlay.style.display == "none") {
            window.MC.setNick(skins[Math.random() * skins.length | 0]);
        }
    }, 1e3);
});

Post reply

Sign in to post a reply.