CryptoFaucet Auto BTC Claim

Automatically navigates to BTC faucet and clicks all actionable buttons.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         CryptoFaucet Auto BTC Claim
// @namespace    https://cryptofaucet.club/
// @version      1.0
// @description  Automatically navigates to BTC faucet and clicks all actionable buttons.
// @author       Rubystance
// @license      MIT
// @match        https://cryptofaucet.club/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const REFERRAL_CODE = '114799';

    try {
        if (!document.cookie.includes('ref=' + REFERRAL_CODE)) {
            document.cookie =
                'ref=' + REFERRAL_CODE +
                '; path=/; max-age=31536000; SameSite=Lax';
        }
    } catch (_) {

    }

    const CHECK_INTERVAL = 1000;

    function navigateToBTC() {
        if (location.pathname.includes('/claim/btc')) return; // << CHANGE_THE_BTC_FOR_DOGE_IF_YOU_WANT_TO_CLAIM_ANOTHER_CRYPTO

        const btcLink = document.querySelector(
            'a[href="/claim/btc/"]'
        );

        if (!btcLink) return;

        console.log('[CryptoFaucet Script] Navigating to BTC faucet...');
        btcLink.click();
    }

    function clickAllFaucetButtons() {
        const buttons = document.querySelectorAll(
            'input[type="button"][style*="max-width"]'
        );

        buttons.forEach(btn => {
            if (btn.disabled) return;
            if (btn.dataset.tmClicked) return;

            const rect = btn.getBoundingClientRect();
            if (rect.width === 0 || rect.height === 0) return;

            btn.dataset.tmClicked = 'true';

            console.log(
                '[CryptoFaucet Script] Clicking:',
                btn.value || '(unnamed button)'
            );

            btn.click();
        });
    }

    setInterval(() => {

        navigateToBTC();

        if (location.pathname.includes('/claim/btc')) { // << CHANGE_THE_BTC_FOR_DOGE_IF_YOU_WANT_TO_CLAIM_ANOTHER_CRYPTO
            clickAllFaucetButtons();
        }

    }, CHECK_INTERVAL);

})();