Auto Claim Earncryptowrs

Autofills email, waits for CAPTCHA and automates LTC claim on dashboard and faucet pages.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Auto Claim Earncryptowrs
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Autofills email, waits for CAPTCHA and automates LTC claim on dashboard and faucet pages.
// @author       Rubystance
// @license      MIT
// @match        https://earncryptowrs.in/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const email = "YOUR_FAUCETPAY_EMAIL_HERE"; // <<== Replace this with your FaucetPay email

    function waitForElement(selector, timeout = 10000) {
        return new Promise((resolve, reject) => {
            const intervalTime = 100;
            let elapsed = 0;
            const interval = setInterval(() => {
                const el = document.querySelector(selector);
                if (el) {
                    clearInterval(interval);
                    resolve(el);
                } else if (elapsed >= timeout) {
                    clearInterval(interval);
                    reject(`Element ${selector} not found after ${timeout}ms.`);
                }
                elapsed += intervalTime;
            }, intervalTime);
        });
    }

    async function autoLogin() {
        if (window.location.pathname === "/" || window.location.pathname === "/index") {
            try {
                const input = await waitForElement('input[name="wallet"]');
                input.value = email;

                const observer = new MutationObserver((mutations, obs) => {
                    const verificationMessage = document.querySelector('.iconcaptcha-modal__body-title');
                    if (verificationMessage && verificationMessage.textContent.includes("Verification complete")) {
                        const loginBtn = document.querySelector('button[type="submit"]');
                        if (loginBtn) {
                            loginBtn.click();
                            obs.disconnect();
                        }
                    }
                });

                observer.observe(document.body, { childList: true, subtree: true });

            } catch (e) {
                console.error("Error in autoLogin:", e);
            }
        }
    }

    async function goToFaucetPage() {
        if (window.location.pathname === "/app/dashboard") {
            const claimLink = await waitForElement('a[href*="/app/faucet?currency=LTC"]');
            claimLink.click();
        }
    }

    async function autoClaim() {
        if (window.location.pathname.startsWith("/app/faucet")) {
            const observer = new MutationObserver((mutations, obs) => {
                const verificationMessage = document.querySelector('.iconcaptcha-modal__body-title');
                if (verificationMessage && verificationMessage.textContent.includes("Verification complete")) {
                    const claimBtn = document.querySelector('button.claim-button');
                    if (claimBtn) {
                        claimBtn.click();
                        obs.disconnect();
                    }
                }
            });

            observer.observe(document.body, { childList: true, subtree: true });
        }
    }

    window.addEventListener('load', () => {
        autoLogin();
        goToFaucetPage();
        autoClaim();
    });

})();