Faucet Auto Clicker - Feyorra

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);
    });
})();