Freebitco.in Auto ROLL | With Turnstile CloudFlare CAPTCHA

Automatically clicks “ROLL” when the Turnstile Cloudflare CAPTCHA is solved.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Freebitco.in Auto ROLL | With Turnstile CloudFlare CAPTCHA
// @namespace    https://freebitco.in/
// @version      1.1
// @description  Automatically clicks “ROLL” when the Turnstile Cloudflare CAPTCHA is solved.
// @author       Rubystance
// @license      MIT
// @match        https://freebitco.in/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const log = (...args) => console.log('[AutoROLL]', ...args);

    function isCaptchaResolved() {
        const input = document.querySelector('input[name="cf-turnstile-response"]');
        return input && input.value.trim().length > 0;
    }

    function tryClickRollButton() {
        const button = document.getElementById('free_play_form_button');
        if (!button) {
            log("ROLL! not found.");
            return;
        }

        if (isCaptchaResolved() && !button.disabled && button.offsetParent !== null) {
            log("CAPTCHA solved. Clicking on ROLL! button");
            button.click();
        } else {
            log("Waiting for CAPTCHA...");
        }
    }

    function observeCaptcha() {
        const captchaInput = document.querySelector('input[name="cf-turnstile-response"]');

        if (!captchaInput) {
            log("CAPTCHA fiel not detected. Repeating in 2s...");
            setTimeout(observeCaptcha, 2000);
            return;
        }

        const observer = new MutationObserver(() => {
            if (isCaptchaResolved()) {
                log("CAPTCHA detected!");
                tryClickRollButton();
            }
        });

        observer.observe(captchaInput, { attributes: true, attributeFilter: ['value'] });

        setInterval(() => {
            if (isCaptchaResolved()) {
                tryClickRollButton();
            }
        }, 1000);

        log("Waiting for CAPTCHA to detect a solution...");
    }

    window.addEventListener('load', () => {
        setTimeout(observeCaptcha, 2000);
    });
})();