1f(AB)

Stealth auto claim for 1f

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         1f(AB)
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Stealth auto claim for 1f
// @author       👽
// @match        https://onefaucet.in/faucet
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function simulateRealClick(elem) {
        if (!elem) return;
        console.log('Simulating real click...');
        // Use the built-in click method, which is closest to a real user click
        elem.click();
    }

    function findClaimButton() {
        let btn = document.querySelector('button.claim-button.btn.btn-primary');
        if (!btn) {
            btn = [...document.querySelectorAll('button')].find(b =>
                b.textContent.toLowerCase().includes('collect your reward')
            );
        }
        return btn;
    }

    function waitForAntibotAndClick() {
        console.log('Waiting for antibot check to finish...');
        let attempts = 0;
        const maxAttempts = 30;

        const checkInterval = setInterval(() => {
            const antibotPassed = document.querySelector('#antibotlinks')?.value?.trim()?.length > 0;
            attempts++;

            if (antibotPassed) {
                console.log('Antibot passed.');
                clearInterval(checkInterval);

                const delay = 1500 + Math.random() * 1500; // 1.5s to 3s delay
                setTimeout(() => {
                    let clickAttempts = 0;

                    const clickInterval = setInterval(() => {
                        const btn = findClaimButton();
                        clickAttempts++;

                        if (btn && !btn.disabled) {
                            console.log('Clicking claim button...');
                            simulateRealClick(btn);
                            clearInterval(clickInterval);
                        } else {
                            console.log(`Claim button not ready yet. Retry #${clickAttempts}`);
                            if (clickAttempts >= 10) {
                                console.log('Claim button never became clickable. Giving up.');
                                clearInterval(clickInterval);
                            }
                        }
                    }, 1000 + Math.random() * 500); // Randomize retries
                }, delay);
            } else {
                console.log(`Antibot check not passed yet. Attempt ${attempts}`);
                if (attempts >= maxAttempts) {
                    console.log('Gave up waiting for antibot.');
                    clearInterval(checkInterval);
                }
            }
        }, 1000 + Math.random() * 500);
    }

    // Wait for full load
    window.addEventListener('load', () => {
        const startDelay = 500 + Math.random() * 1000; // 0.5s–1.5s
        console.log(`Script started. Initial delay: ${startDelay.toFixed(0)}ms`);
        setTimeout(() => {
            waitForAntibotAndClick();
        }, startDelay);
    });
})();