Agar.io Skin Changer

Agario Hack

< 腳本Agar.io Skin Changer的回應

提問/評論

§
發表於: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);
});

發表回覆

登入以回復