Faucet Auto Clicker - Feyorra

Automatically clicks the CAPTCHA checkbox and the claim button when ready.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Faucet Auto Clicker - Feyorra
// @namespace    https://feyorra.site/
// @version      1.0
// @description  Automatically clicks the CAPTCHA checkbox and the claim button when ready.
// @author       Rubystance
// @license      MIT
// @match        https://feyorra.site/member/faucet
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    function waitForElement(selector, callback, interval = 500, timeout = 15000) {
        const start = Date.now();
        const timer = setInterval(() => {
            const el = document.querySelector(selector);
            if (el) {
                clearInterval(timer);
                callback(el);
            } else if (Date.now() - start > timeout) {
                clearInterval(timer);
                console.warn(`[!] Element not found: ${selector}`);
            }
        }, interval);
    }

    function isButtonClickable(button) {
        const style = window.getComputedStyle(button);
        return (
            style.display !== 'none' &&
            style.visibility !== 'hidden' &&
            !button.disabled &&
            button.offsetParent !== null
        );
    }

    waitForElement('#verifyCheckbox', (checkbox) => {
        if (!checkbox.checked) {
            checkbox.click();
            console.log('[✓] Checkbox clicked.');
        } else {
            console.log('[✓] Checkbox already checked.');
        }

        const checkCaptchaInterval = setInterval(() => {
            if (checkbox.checked) {
                console.log('[✓] CAPTCHA solved.');

                const claimInterval = setInterval(() => {
                    const btn = document.querySelector('#ClaimBtn');
                    if (btn && isButtonClickable(btn)) {
                        btn.click();
                        console.log('[✓] Claim button clicked.');
                        clearInterval(claimInterval);
                    } else {
                        console.log('[...] Waiting for Claim button to become available...');
                    }
                }, 1000);

                clearInterval(checkCaptchaInterval);
            } else {
                console.log('[...] Waiting for CAPTCHA to be solved...');
            }
        }, 1000);
    });
})();