Auto Minting

Minting automatically at the academy at random intervals

目前為 2024-10-31 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Auto Minting
// @version      1
// @description  Minting automatically at the academy at random intervals
// @include      https://*/game.php*screen=snob*
// @namespace https://gf.qytechs.cn/users/1388863
// ==/UserScript==

(function() {
    'use strict';

    let countdownInterval;
    let isMinting = true; 
    let countdownTime; 

    // Membuat tombol Start/Stop Minting
    let toggleButton = document.createElement("button");
    toggleButton.innerText = "Stop Minting"; 
    toggleButton.style.position = "fixed";
    toggleButton.style.bottom = "20px";
    toggleButton.style.right = "20px";
    toggleButton.style.padding = "8px 15px";
    toggleButton.style.fontSize = "16px";
    toggleButton.style.zIndex = "1000";
    toggleButton.style.backgroundColor = "#FF0000"; 
    toggleButton.style.color = "white";
    toggleButton.style.border = "none";
    toggleButton.style.borderRadius = "5px";
    toggleButton.style.cursor = "pointer";

    let countdownPopup = document.createElement("div");
    countdownPopup.style.position = "fixed";
    countdownPopup.style.bottom = "60px";
    countdownPopup.style.right = "20px";
    countdownPopup.style.padding = "8px 15px";
    countdownPopup.style.fontSize = "14px";
    countdownPopup.style.zIndex = "1000";
    countdownPopup.style.backgroundColor = "#333";
    countdownPopup.style.color = "white";
    countdownPopup.style.borderRadius = "5px";
    countdownPopup.style.display = "none"; 

    document.body.appendChild(toggleButton);
    document.body.appendChild(countdownPopup);


    function mintCoins() {
        const maxCoinElement = document.getElementById("coin_mint_fill_max");
        const maxCoinValue = maxCoinElement ? parseInt(maxCoinElement.textContent.match(/\((\d+)\)/)[1], 10) : null;

        if (maxCoinValue !== null) {
            document.getElementById("coin_mint_count").value = maxCoinValue;

            const mintButton = document.querySelector("input[type='submit'][value='Mint']");
            if (mintButton) {
                mintButton.click();
                console.log("Tombol 'Mint' diklik dengan nilai:", maxCoinValue);
            } else {
                console.log("Tombol 'Mint' tidak ditemukan.");
            }
        } else {
            console.log("Tidak dapat menemukan nilai maksimum.");
        }
    }

    function startCountdown() {
        countdownPopup.style.display = "block";
        countdownTime = Math.floor(Math.random() * (600 - 300 + 1)) + 300;

        countdownInterval = setInterval(() => {
            countdownTime--;
            const minutes = Math.floor(countdownTime / 60);
            const seconds = countdownTime % 60;
            countdownPopup.innerText = `Next mint in: ${minutes}m ${seconds}s`;

            if (countdownTime <= 0) {
                location.reload(); 
            }
        }, 1000);
    }

    function stopCountdown() {
        clearInterval(countdownInterval);
        countdownPopup.style.display = "none"; 
    }


    function toggleMinting() {
        if (isMinting) {
            stopCountdown();
            isMinting = false;
            toggleButton.innerText = "Start Minting";
            toggleButton.style.backgroundColor = "#4CAF50";
            console.log("Minting dihentikan.");
        } else {
            const delay = Math.floor(Math.random() * (5000 - 3000 + 1)) + 3000; 

            setTimeout(() => {
                mintCoins();
                startCountdown(); 
            }, delay);

            isMinting = true;
            toggleButton.innerText = "Stop Minting";
            toggleButton.style.backgroundColor = "#FF0000";
            console.log("Minting dimulai.");
        }
    }

    toggleButton.addEventListener("click", toggleMinting);

    const initialDelay = Math.floor(Math.random() * (5000 - 3000 + 1)) + 3000; 
    setTimeout(() => {
        mintCoins();
        startCountdown(); 
    }, initialDelay);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址