Snake.io cheat (Zoom Hack)

Cheats for snake.io (Zoom hack)

2025-05-03 기준 버전입니다. 최신 버전을 확인하세요.

// ==UserScript==
// @name         Snake.io cheat (Zoom Hack)
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Cheats for snake.io (Zoom hack)
// @author       idk just not you
// @license      MIT
// @match        https://snake.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=snake.io
// @grant        none
// ==/UserScript==

(function() {
    function get(x) { return document.getElementById(x); }

    // Создаем стили для меню
    const style = document.createElement('style');
    style.textContent = `
        #cheatMenu {
            font-family: 'Arial', sans-serif;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            padding: 15px;
            width: 250px;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
        }
        
        #cheatMenu:hover {
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
        }
        
        #cheatMenu section {
            margin-bottom: 12px;
        }
        
        #cheatMenu label {
            display: block;
            margin-bottom: 5px;
            font-size: 14px;
            color: #333;
            font-weight: bold;
        }
        
        #cheatMenu input[type="range"] {
            width: 100%;
            height: 8px;
            border-radius: 4px;
            background: #e0e0e0;
            outline: none;
            -webkit-appearance: none;
        }
        
        #cheatMenu input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #4a6bff;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        #cheatMenu input[type="range"]::-webkit-slider-thumb:hover {
            background: #3a5bef;
            transform: scale(1.1);
        }
        
        /* Стили для переключателя AutoRun */
        .switch-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 15px;
            padding-top: 10px;
            border-top: 1px solid #eee;
        }
        
        .switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }
        
        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 24px;
        }
        
        .slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }
        
        input:checked + .slider {
            background-color: #4a6bff;
        }
        
        input:checked + .slider:before {
            transform: translateX(26px);
        }
        
        .slider:hover {
            box-shadow: 0 0 5px rgba(74, 107, 255, 0.5);
        }
        
        #cheatMenu section.value-display {
            text-align: center;
            font-size: 16px;
            font-weight: bold;
            color: #4a6bff;
            margin: 5px 0 15px 0;
        }
    `;
    document.head.appendChild(style);

    let cheatMenu = document.createElement("div");
    cheatMenu.id = "cheatMenu";
    cheatMenu.style.position = "absolute";
    cheatMenu.style.top = "30px";
    cheatMenu.style.left = "20px";
    cheatMenu.style.zIndex = "9999";

    cheatMenu.innerHTML = `
        <section>
            <label for="WS">Canvas width:</label>
            <input type="range" min="1" max="3264" value="1332" id="WS">
        </section>
        <section class="value-display">
            <span id="WV">1332</span>
        </section>
        
        <section>
            <label for="HS">Canvas height:</label>
            <input type="range" min="1" max="3264" value="764" id="HS">
        </section>
        <section class="value-display">
            <span id="HV">764</span>
        </section>
        
        <section>
            <label for="ZOOM">Zoom:</label>
            <input type="range" min="0.5" max="15" value="1" step="0.01" id="ZOOM">
        </section>
        <section class="value-display">
            <span id="ZM">1</span>
        </section>
        
        <div class="switch-container">
            <label for="autoRunSwitch">AutoRun:</label>
            <label class="switch">
                <input type="checkbox" id="autoRunSwitch">
                <span class="slider"></span>
            </label>
        </div>
    `;

    document.body.appendChild(cheatMenu);

    let box = get("cheatMenu");

    // Добавляем возможность перетаскивания меню
    let isDragging = false;
    let offsetX, offsetY;

    box.addEventListener('mousedown', (e) => {
        if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'LABEL') {
            isDragging = true;
            offsetX = e.clientX - box.getBoundingClientRect().left;
            offsetY = e.clientY - box.getBoundingClientRect().top;
            box.style.cursor = 'grabbing';
        }
    });

    document.addEventListener('mousemove', (e) => {
        if (isDragging) {
            box.style.left = (e.clientX - offsetX) + 'px';
            box.style.top = (e.clientY - offsetY) + 'px';
        }
    });

    document.addEventListener('mouseup', () => {
        isDragging = false;
        box.style.cursor = '';
    });

    document.addEventListener("keydown", (event) => {
        if (event.keyCode == 89) { // Нажатие "Y" скрывает/показывает меню
            box.style.display = (box.style.display === "none") ? "block" : "none";
        }
    });

    let CanvasWidth = get("WS");
    let showWidth = get("WV");
    CanvasWidth.oninput = function() {
        showWidth.innerHTML = this.value;
        let gameCanvas = get("unity-canvas");
        if (gameCanvas) gameCanvas.style.width = this.value + "px";
    };

    let CanvasHeight = get("HS");
    let showHeight = get("HV");
    CanvasHeight.oninput = function() {
        showHeight.innerHTML = this.value;
        let gameCanvas = get("unity-canvas");
        if (gameCanvas) gameCanvas.style.height = this.value + "px";
    };

    let ZoomVS = get("ZOOM");
    let ShowZoomVS = get("ZM");
    ZoomVS.oninput = function() {
        let zoomValue = parseFloat(this.value);
        let gameCanvas = get("unity-canvas");
        let gameContainer = get("unity-container");

        ShowZoomVS.innerHTML = this.value;

        if (gameContainer) {
            gameContainer.style.transform = "scale(" + zoomValue + ")";
            gameContainer.style.transformOrigin = "center";
            gameContainer.style.position = "absolute";
            gameContainer.style.top = "50%";
            gameContainer.style.left = "50%";
            gameContainer.style.transform = "translate(-50%, -50%) scale(" + zoomValue + ")";
            gameContainer.style.overflow = "hidden";
        }

        if (gameCanvas) {
            gameCanvas.style.transform = "scale(" + zoomValue + ")";
            gameCanvas.style.transformOrigin = "center";
        }

        const otherApps = document.getElementById("otherKooApps");
        if (otherApps) otherApps.style.opacity = 0;
    };

    const autoRunSwitch = get("autoRunSwitch");
    let isMouseDown = false;

    autoRunSwitch.addEventListener('change', function() {
        const canvas = get('unity-canvas');
        if (!canvas) return;

        if (this.checked) {
            const mouseDownEvent = new MouseEvent('mousedown', {
                bubbles: true,
                cancelable: true,
                view: window,
                clientX: canvas.width / 2,
                clientY: canvas.height / 2
            });
            canvas.dispatchEvent(mouseDownEvent);
            isMouseDown = true;
        } else {
            const mouseUpEvent = new MouseEvent('mouseup', {
                bubbles: true,
                cancelable: true,
                view: window
            });
            canvas.dispatchEvent(mouseUpEvent);
            isMouseDown = false;
        }
    });
})();