Freebitco.in Smart Auto Claim v5.1 (Cloudflare + Mobile Safe)

Freebitco.in auto claim with Cloudflare bypass, verify, roll, and Telegram alerts (mobile-safe)

目前為 2025-07-02 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Freebitco.in Smart Auto Claim v5.1 (Cloudflare + Mobile Safe)
// @namespace    http://tampermonkey.net/
// @version      5.1
// @description  Freebitco.in auto claim with Cloudflare bypass, verify, roll, and Telegram alerts (mobile-safe)
// @match        https://freebitco.in/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const CLAIM_INTERVAL = 60 * 60 * 1000;  // 1 hour
    const FALLBACK_RELOAD = 10 * 60 * 1000; // 10 minutes
    const TELEGRAM_TOKEN = 'YOUR_TELEGRAM_BOT_TOKEN'; //Replace YOUR_TELEGRAM_BOT_TOKEN
    const TELEGRAM_CHAT_ID = 'YOUR_CHAT_ID'; //Replace YOUR_TELEGRAM_CHAT_ID

    let claimed = false;

    function sendTelegram(msg) {
        fetch(`https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage`, {
            method: 'POST',
            headers: {'Content-Type': 'application/json'},
            body: JSON.stringify({chat_id: TELEGRAM_CHAT_ID, text: `[Freebitco.in]\n${msg}`})
        }).catch(console.error);
    }

    function getLast() {
        return parseInt(localStorage.getItem("fbtc_last") || "0");
    }
    function setLast(ts) {
        localStorage.setItem("fbtc_last", ts);
    }

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

    // Poll for Cloudflare challenge done
    async function waitForCloudflare(timeout = 20000) {
        const start = Date.now();
        while (Date.now() - start < timeout) {
            const cf = document.querySelector("div[data-translate='checking_browser']");
            if (!cf) return;
            await wait(500);
        }
        throw new Error("Cloudflare timeout");
    }

    // Try clicking verify button
    async function clickVerify() {
        const btn = document.querySelector("input[value*='Verify'], button#verify_play");
        if (btn) {
            btn.click();
            console.log("[v5.1] clicked verify");
            await wait(5000);
        }
    }

    // Try clicking roll button
    async function clickRoll() {
        const roll = document.querySelector("#free_play_form_button");
        if (roll) {
            roll.click();
            console.log("[v5.1] clicked roll");
            claimed = true;
            setLast(Date.now());
            sendTelegram("✅ Claimed at " + new Date().toLocaleTimeString());
            return true;
        }
        throw new Error("ROLL not found");
    }

    async function claimFlow() {
        const now = Date.now(), last = getLast();
        if (now - last < CLAIM_INTERVAL) return;

        claimed = false;
        try {
            await waitForCloudflare();
            await clickVerify();
            await clickRoll();
        } catch (err) {
            console.warn("[v5.1]", err.message);
            sendTelegram("⚠️ Claim failed: " + err.message);
        }
    }

    // Fallback & auto-retry
    setTimeout(() => { if (!claimed) location.reload(); }, FALLBACK_RELOAD);
    setInterval(() => {
        if (!claimed && Date.now() - getLast() >= CLAIM_INTERVAL) location.reload();
    }, 60000);

    // Start flow after load
    window.addEventListener("load", () => setTimeout(claimFlow, 3000));

})();