Snake.io Cheat GUI with Backend

Adds cheats and custom audio to Snake.io with server-side interaction.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Snake.io Cheat GUI with Backend
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Adds cheats and custom audio to Snake.io with server-side interaction.
// @author       Your Name
// @match        *://snake.io/*
// @grant        GM_xmlhttpRequest
// @connect      your-backend-server.com
// ==/UserScript==

(function() {
    'use strict';

    // Create GUI
    const gui = document.createElement('div');
    gui.style.position = 'fixed';
    gui.style.top = '10px';
    gui.style.left = '10px';
    gui.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
    gui.style.color = 'white';
    gui.style.padding = '10px';
    gui.style.zIndex = '1000';
    gui.style.borderRadius = '5px';
    gui.style.fontFamily = 'Arial, sans-serif';
    gui.innerHTML = `
        <h3>Snake.io Cheats</h3>
        <button id="barrierBypass">Barrier Bypass</button><br><br>
        <button id="speedBoost">Speed Boost</button><br><br>
        <button id="characterChanger">Change Character</button><br><br>
        <input type="text" id="nameChanger" placeholder="Enter New Name"><br><br>
        <button id="applyNameChange">Change Name</button><br><br>
        <input type="text" id="audioURL" placeholder="Enter YouTube Audio URL"><br><br>
        <button id="applyAudioChange">Change Audio</button><br><br>
    `;
    document.body.appendChild(gui);

    // Helper function for server communication
    function sendToBackend(action, data) {
        GM_xmlhttpRequest({
            method: 'POST',
            url: 'https://your-backend-server.com/api/cheats',
            headers: { 'Content-Type': 'application/json' },
            data: JSON.stringify({ action, data }),
            onload: function(response) {
                console.log('Server response:', response.responseText);
            },
            onerror: function(error) {
                console.error('Error communicating with the server:', error);
            }
        });
    }

    // Cheat Functions
    function barrierBypass() { sendToBackend('barrierBypass'); }
    function speedBoost() { sendToBackend('speedBoost'); }
    function changeCharacter() { sendToBackend('changeCharacter'); }
    function changeName(newName) { sendToBackend('changeName', newName); }
    function startCustomAudio(url) { sendToBackend('customAudio', url); }

    // Event Listeners for GUI buttons
    document.getElementById('barrierBypass').addEventListener('click', barrierBypass);
    document.getElementById('speedBoost').addEventListener('click', speedBoost);
    document.getElementById('characterChanger').addEventListener('click', changeCharacter);
    document.getElementById('applyNameChange').addEventListener('click', () => {
        const newName = document.getElementById('nameChanger').value;
        if (newName) { changeName(newName); }
    });
    document.getElementById('applyAudioChange').addEventListener('click', () => {
        const audioURL = document.getElementById('audioURL').value;
        if (audioURL) { startCustomAudio(audioURL); }
    });

})();