Stake.bet Auto Claim Reload (First Button) with Timer, Flashing, and Sound

Automatically claims the first "Claim Reload" button every 10 minutes and 20 seconds, clicks off, then repeats. Refreshes after every 3 claims.

目前為 2025-03-12 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Stake.bet Auto Claim Reload (First Button) with Timer, Flashing, and Sound
// @namespace    http://tampermonkey.net/
// @version      3.8
// @description  Automatically claims the first "Claim Reload" button every 10 minutes and 20 seconds, clicks off, then repeats. Refreshes after every 3 claims.
// @author       jfbaby
// @match        https://stake.bet/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let claimCount = 0;
    let countdownTime = 620; // 10 minutes 20 seconds

    function createTimer() {
        const timer = document.createElement('div');
        Object.assign(timer.style, {
            position: 'fixed', top: '1.5cm', left: '0', backgroundColor: 'black', color: 'white',
            padding: '10px', fontFamily: 'monospace', fontSize: '20px', zIndex: '10000', borderRadius: '5px'
        });
        timer.id = 'countdown-timer';
        timer.textContent = '10:20';
        document.body.appendChild(timer);
        return timer;
    }

    function updateTimer(timer, timeInSeconds) {
        const minutes = Math.floor(timeInSeconds / 60);
        const seconds = timeInSeconds % 60;
        timer.textContent = `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
        timer.style.backgroundColor = timeInSeconds <= 5 ? (timer.style.backgroundColor === 'black' ? 'red' : 'black') : 'black';
    }

    function playSound() {
        const sound = new Audio('https://assets.mixkit.co/active_storage/sfx/1121/1121-preview.mp3');
        sound.volume = 0.5;
        sound.play();
    }

    function forceClick(element) {
        if (!element) return;
        element.scrollIntoView({ behavior: 'smooth', block: 'center' });
        ['mouseover', 'mousedown', 'mouseup', 'click'].forEach(eventType => {
            element.dispatchEvent(new MouseEvent(eventType, { bubbles: true, cancelable: true, view: window }));
        });
        console.log("Tried to force-click the button.");
    }

    function clickClaimReload() {
        let buttons = Array.from(document.querySelectorAll('button'));
        let reloadButton = buttons.find(button => button.innerText.trim().toLowerCase().includes('claim reload'));

        if (reloadButton) {
            console.log('Claim Reload button found!', reloadButton);
            forceClick(reloadButton);
            playSound();
            claimCount++;

            setTimeout(() => {
                let closeButton = document.querySelector('[data-testid="modal-close"]');
                if (closeButton) {
                    console.log("Clicking off the box");
                    forceClick(closeButton);
                }
            }, 2000);
        } else {
            console.log('Claim Reload button not found!');
        }
    }

    function isOnRewardsPage() {
        return window.location.href.includes("tab=rewards&modal=claimReload");
    }

    function main() {
        if (isOnRewardsPage()) {
            clickClaimReload();
        } else {
            console.log("Navigating to the rewards page...");
            window.history.back();
        }
    }

    const timer = createTimer();
    const timerInterval = setInterval(() => {
        countdownTime -= 1;
        updateTimer(timer, countdownTime);

        if (countdownTime <= 0) {
            countdownTime = 620;
            updateTimer(timer, countdownTime);
            main();

            setTimeout(() => {
                console.log("Clicking back to rewards page");
                window.history.forward();
            }, 30000); // 30 seconds after claiming, go back

            if (claimCount >= 3) {
                setTimeout(() => {
                    console.log("Refreshing after 3 claims");
                    location.reload();
                }, 60000); // Wait 30 seconds before refreshing
                claimCount = 0;
            }
        }
    }, 1000);
})();