Auto Reload on Stake.com - CodeStats edition

Automatically claims rewards on Stake.com by sequentially clicking VIP Reward → Claim Reload → Return to Rewards. The script starts after a short page-load delay, mimics human behavior with random delays, occasional skipped cycles, and subtle mouse/scroll movements. FREE BONUS CODES @ https://t.me/codestats2 SOL: FVDejAWbUGsgnziRvFi4eGkJZuH6xuLviuTdi2g4Ut3o

目前為 2025-09-23 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Auto Reload on Stake.com - CodeStats edition
// @description  Automatically claims rewards on Stake.com by sequentially clicking VIP Reward → Claim Reload → Return to Rewards. The script starts after a short page-load delay, mimics human behavior with random delays, occasional skipped cycles, and subtle mouse/scroll movements. FREE BONUS CODES @ https://t.me/codestats2   SOL: FVDejAWbUGsgnziRvFi4eGkJZuH6xuLviuTdi2g4Ut3o
// @author       CHUBB
// @namespace    https://t.me/codestats2
// @version      09.22.2025
// @match        https://stake.com/*
// @match        https://stake.us/*
// @match        https://stake.com/?tab=rewards&modal=vip
// @match        https://stake.us/?tab=rewards&modal=vip
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

// ===== HUD SETUP =====
function setupHUD() {
    let hud = document.createElement("div");
    hud.id = "autoReloadHUD";
    hud.style.cssText = `
        position: fixed;
        bottom: 10px;
        right: 10px;
        width: 650px;
        max-height: 200px;
        overflow-y: auto;
        font-size: 14px;
        background: rgba(0,0,0,0.8);
        color: #0f0;
        padding: 10px;
        border-radius: 8px;
        font-family: monospace;
        z-index: 999999;
    `;
    hud.innerHTML = `<b>Auto Reload Bot</b><br><div id="hudLog"></div><div id="hudTimer"></div>`;
    document.body.appendChild(hud);
}
setupHUD();

function logHUD(msg) {
    let log = document.getElementById("hudLog");
    if (log) {
        let line = document.createElement("div");
        line.textContent = `[${new Date().toLocaleTimeString()}] ${msg}`;
        log.appendChild(line); // add new line at the bottom
        while (log.childNodes.length > 3) log.removeChild(log.firstChild); // trim from top
        log.scrollTop = log.scrollHeight; // auto-scroll to bottom
    }
    console.log(msg);
}



function updateTimer(ms) {
    let el = document.getElementById("hudTimer");
    if (!el) return;
    let sec = Math.floor(ms / 1000);
    let m = Math.floor(sec / 60);
    let s = sec % 60;
    el.textContent = `Next attempt in ${m}m ${s}s`;
}

// ===== CLICK FUNCTION =====
async function orderedClick(selector, retries = 5, interval = 3000) {
    for (let i = 0; i < retries; i++) {
        const el = document.querySelector(selector);
        if (el) {
            const delay = Math.floor(Math.random() * 2000) + 1000;
            await wait(delay);
            el.click();
            logHUD(`Clicked: ${selector} (after ${delay}ms)`);
            return true;
        }
        await wait(interval);
    }
    logHUD(`FAILED: ${selector}`);
    return false;
}

// ===== CLAIM FUNCTION =====
async function claimReload() {
    simulateMouseMove();

    await orderedClick('button[data-testid="progress-tab"]');
    await orderedClick('button[data-testid="rewards-tab"]');
    await orderedClick('button[data-testid="vip-reward-claim-reload"]');

    // The MONEY button
    const claimSuccess = await orderedClick('button[data-testid="claim-reload"]');

    if (claimSuccess) {
        // If we successfully clicked claim, we *must* try to wrap up
        const finalStep = await orderedClick('button[data-testid="return-to-rewards"]');
        if (!finalStep) {
            logHUD("Claimed reload but couldn't return → reloading page...");
            window.location.href = "https://stake.com/?tab=progress&modal=vip";
            return;
        }
    }

    simulateMouseMove();
    logHUD("Finished reload attempt.");
}


// ===== CYCLE FUNCTION =====
function startCycle() {
    const min = 10 * 60 * 1000;
    const max = 12 * 60 * 1000;
    const delay = Math.floor(Math.random() * (max - min + 1)) + min;

    let endTime = Date.now() + delay;
    let timer = setInterval(() => {
        let remaining = endTime - Date.now();
        if (remaining <= 0) {
            clearInterval(timer);
            return;
        }
        updateTimer(remaining);
    }, 1000);

    logHUD(`Next attempt scheduled in ${(delay / 60000).toFixed(2)} minutes`);

    setTimeout(async () => {
        await claimReload();
        startCycle();
    }, delay);
}

// ===== UTILITIES =====
function simulateMouseMove() {
    const simElm = document.documentElement;
    const simMouseMove = new Event('mousemove', { bubbles: true });
    simElm.dispatchEvent(simMouseMove);
}

function wait(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

// ===== INITIAL RUN =====
(function firstRun() {
    const firstDelay = Math.floor(Math.random() * 5000) + 5000;
    logHUD(`First attempt in ${(firstDelay / 1000).toFixed(1)}s`);
    setTimeout(async () => {
        await claimReload();
        startCycle();
    }, firstDelay);
})();