Snake.io Cheat GUI with Backend

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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); }
    });

})();