TRX Auto

Faucet automatic collection 24 hours a day

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         TRX Auto
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  Faucet automatic collection 24 hours a day
// @author       ALEN
// @icon         https://i.imgur.com/tnqS60o.jpeg
// @match        https://freetron.in/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const VERIFY_INPUT_SELECTOR = 'input[name="cf-turnstile-response"]';
    const CLAIM_BUTTON_TEXT = 'Claim';
    const CHECK_INTERVAL = 2000;
    let hasClaimed = false;

    function isVerificationComplete() {
        const verifyInput = document.querySelector(VERIFY_INPUT_SELECTOR);
        return verifyInput && verifyInput.value.trim() !== '';
    }

    function clickClaimButton() {
        if (hasClaimed) return;
        const buttons = document.querySelectorAll('button');
        for (const button of buttons) {
            if (button.textContent.trim().toUpperCase() === CLAIM_BUTTON_TEXT.toUpperCase()) {
                console.log('驗證通過!正在點擊 Claim 按鈕...');
                button.click();
                hasClaimed = true;
                return;
            }
        }
        console.log('Claim 按鈕未找到,將稍後重試...');
    }

    function checkVerificationAndClick() {
        if (isVerificationComplete()) {
            console.log('驗證完成,觸發點擊動作!');
            clickClaimButton();
        } else {
            console.log('驗證尚未完成,等待中...');
        }
    }

    setInterval(checkVerificationAndClick, CHECK_INTERVAL);

    // 每 30 分鐘自動重新整理頁面
    setTimeout(() => {
        console.log('30 分鐘到,自動重新整理頁面...');
        location.reload();
    }, 30 * 60 * 1000); // 30 分鐘
})();