Bonk win changer

you can change the win system the text of win

// ==UserScript==
// @name         Bonk win changer
// @namespace    http://tampermonkey.net/
// @version      01
// @description  you can change the win system the text of win
// @author       emiya440 + chatgpt
// @match        https://bonk.io/*
// @match        https://bonkisback.io/*
// @icon         https://media.printables.com/media/prints/276279/images/2452856_a9ea5f29-94c4-4983-b9e6-b872cf7b0dfb/thumbs/inside/1280x960/png/boob-grab.webp
// @grant        none
// ==/UserScript==
// Créer un bouton et l'ajouter au body
const button = document.createElement("button");
button.id = "injector";
button.innerHTML = "Inject (when the game start)";
button.title = "not injected";
button.onclick = Inject;

// Style pour aligner le bouton à gauche
button.style.position = "absolute"; // ou "fixed", selon le besoin
button.style.left = "10px"; // Distance du bord gauche
button.style.top = "10px"; // Distance du bord supérieur
document.body.appendChild(button);

// Créer un input pour contenir le texte à injecter
const inpute = document.createElement("input");
inpute.id = "code";
inpute.type = "text";
inpute.value = "Gg"; // Définir la valeur par défaut ici
inpute.style.position = "absolute"; // Assurez-vous que l'input est positionné correctement
inpute.style.right = "10px"; // Distance du bord droit
inpute.style.top = "10px"; // Distance du bord supérieur
document.body.appendChild(inpute);

// Fonction à exécuter lorsqu'on clique sur le bouton
function Inject() {
    button.textContent = "Wait...";
    button.title = "injected";

    const winshow = document.querySelector("#ingamewinner");
    if (winshow) {
        button.textContent = "Injected! (don't inject two times)";

        // Démarrer la mise à jour du texte toutes les secondes
        const intervalId = setInterval(() => {
            const targetNode = winshow.childNodes[5];
            if (targetNode) {
                targetNode.textContent = inpute.value; // Utilisez .value pour obtenir le texte de l'input
            } else {
                console.log("Element not found. Stopping interval.");
                clearInterval(intervalId); // Arrêter l'intervalle si le nœud cible n'existe plus
            }
        }, 30);
    } else {
        button.textContent = "No injected >:[";
    }
}