Slither.io Zoom Hack WORKING 2025

Allows zooming in and out in Slither.io using keys scroll wheel on mouse. Key 1 reset the zoom - The domain name changed for slither so this has been updated to work.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Slither.io Zoom Hack WORKING 2025
// @namespace    http://slither.io/
// @version      1.0
// @description  Allows zooming in and out in Slither.io using keys scroll wheel on mouse. Key 1 reset the zoom - The domain name changed for slither so this has been updated to work.
// @author       Icewerve
// @grant        none
// @match        http://slither.com/io
// @match        http://slither.io/?c
// @match        http://slither.io
// @license      MIT

// ==/UserScript==

// Enable debug logging
window.logDebugging = false;
window.log = function() {
    if (window.logDebugging) {
        console.log.apply(console, arguments);
    }
};

window.zoomMultiplier = 1.0;

window.updateZoom = function() {
    window.gsc = window.zoomMultiplier;
    // Updated overlay text to reflect new controls
    document.getElementById("zoom_overlay").innerHTML =
        `Scroll to change zoom: ${window.zoomMultiplier.toFixed(1)}`;
};


window.recursiveZoomUpdate = function() {
    window.gsc = window.zoomMultiplier;
    requestAnimationFrame(window.recursiveZoomUpdate);
};


window.resetZoom = function() {
    window.zoomMultiplier = 1.0;
    window.updateZoom();
};

window.adjustZoom = function(amount) {
    // Zoom step adjusted for a smoother scroll experience
    window.zoomMultiplier = Math.max(0.2, Math.min(3.0, window.zoomMultiplier + amount));
    window.updateZoom();
};

// --- REMOVED KEYDOWN HANDLER FOR 8/9 ---
// The original keydown function is preserved for key 1 (reset zoom)
document.oldKeyDown = document.onkeydown;
document.onkeydown = function(e) {
    if (typeof document.oldKeyDown === "function") {
        document.oldKeyDown(e);
    }

    // Only keep the reset zoom functionality (key 49 is '1')
    // and ensure we are not typing in a text field
    if (document.activeElement.parentElement !== window.nick_holder) {
        // Original key codes: 57 ('9'), 56 ('8'), 49 ('1')
        // We only keep the reset zoom (key '1')
        if (e.keyCode === 49) {
            window.resetZoom();
        }
        // Removed: 57 (zoom in) and 56 (zoom out)
    }
};


// --- ADDED MOUSE WHEEL HANDLER ---

document.onwheel = function(e) {
    // We REMOVE the "if (e.ctrlKey)" check here.

    // Prevent the default browser zoom behavior (important!)
    e.preventDefault();

    let zoomStep = 0.05;

    if (e.deltaY < 0) {
        // Scroll up (Zoom In)
        window.adjustZoom(zoomStep);
    } else if (e.deltaY > 0) {
        // Scroll down (Zoom Out)
        window.adjustZoom(-zoomStep);
    }
};


window.initZoomOverlay = function() {
    let overlay = document.createElement("div");
    overlay.id = "zoom_overlay";
    overlay.style = "color: #FFF; font-family: Arial, sans-serif; font-size: 18px; position: fixed; left: 30px; top: 65px; z-index: 1000;";
    // Updated initial overlay text
    overlay.innerHTML = "Scroll to change zoom: " +window.zoomMultiplier.toFixed(1) + '</span>';
    document.body.appendChild(overlay);
};

window.initt = function() {
    window.initZoomOverlay();
    window.updateZoom();
    window.recursiveZoomUpdate();
};

window.initt();