Auto Claim Faucet

Automatically handles login, LTC faucet claiming and reloads the page.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Auto Claim Faucet
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Automatically handles login, LTC faucet claiming and reloads the page.
// @author       Rubystance
// @license      MIT
// @match        https://claimcrypto.in/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const email = "YOUR_FAUCETPAY_EMAIL_HERE"; // ← Replace with your FaucetPay email
    const delay = ms => new Promise(res => setTimeout(res, ms));

    async function autoLogin() {
        const emailInput = document.querySelector('input[name="wallet"]');
        const loginBtn = document.querySelector('button.cta-btn');
        if (emailInput && loginBtn) {
            console.log("[Login] Filling in email...");
            emailInput.value = email;
            await delay(5000);
            loginBtn.click();
        }
    }

    async function goToLTC() {
        const faucetLink = document.querySelector('a.dropdown-item[href="/faucet/currency/ltc"]');
        if (faucetLink) {
            console.log("[Dashboard] Navigating to LTC Faucet...");
            await delay(5000);
            faucetLink.click();
        }
    }

    async function handleClaimNow() {
        const claimBtn = document.querySelector('#subbutt');
        if (claimBtn) {
            console.log("[Faucet] Clicking 'Claim Now'...");
            await delay(10000);
            claimBtn.click();

            console.log("[Faucet] Waiting 3 seconds before reloading...");
            setTimeout(() => {
                location.reload();
            }, 3000);
        }
    }

    function detectAndClickGoClaim() {
        console.log("[Watcher] Looking for 'Go Claim' button...");

        const checkBtn = setInterval(() => {
            const goClaimBtn = [...document.querySelectorAll('a.btn.btn-primary')]
                .find(el => el.textContent.trim().toLowerCase() === "go claim");

            if (goClaimBtn) {
                console.log("[Watcher] 'Go Claim' button found! Clicking...");
                goClaimBtn.click();
                clearInterval(checkBtn);
            }
        }, 1000);

        setTimeout(() => clearInterval(checkBtn), 60000);
    }

    async function main() {
        const path = location.pathname;

        if (path === "/" || path.includes("index")) {
            await delay(1000);
            await autoLogin();
        }

        else if (path === "/dashboard") {
            await delay(1000);
            await goToLTC();
        }

        else if (path === "/faucet/currency/ltc") {
            await delay(1000);
            await handleClaimNow();
            detectAndClickGoClaim();
        }
    }

    main();
})();