Ourinfo.top auto faucet

Automatically Login and Handle Faucet Pages

// ==UserScript==
// @name            Ourinfo.top auto faucet
// @namespace    bekerja pada tampermonkey maupun violentmonkey
// @version         0.5
// @description     Automatically Login and Handle Faucet Pages
// @author          Ojo Ngono
// @grant           GM_getValue
// @grant           GM_setValue
// @grant           GM_addStyle
// @grant           GM_registerMenuCommand
// @require         https://update.gf.qytechs.cn/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
// @match           https://ourinfo.top/*
// @exclude         https://ourinfo.top/auth/login*
// @icon            https://i.ibb.co.com/XJSPdz0/large.png
// @license         Copyright OjoNgono
// @antifeature     referral-link Directs to a referral link when not logged in
// ==/UserScript==

(function () {
    'use strict';

    const cfg = new MonkeyConfig({
        title: 'Input Email Faucetpay:',
        menuCommand: true,
        params: {
            Email: {
                label: "Email Faucetpay",
                type: "text",
                default: ''
            },
        }
    });

    window.addEventListener('load', () => {
        const email = cfg.get('Email').trim();
        if (!email) {
            enforceLogoutWithWarning();
            return;
        }
        if (!isValidEmail(email)) {
            alert('Invalid email address. Please check your configuration.');
            enforceLogoutWithWarning();
            return;
        }
        if (isLoggedIn()) {
            if (isFaucetPage()) {
                checkGoClaimButton();
                autoClickClaimButton();
            } else {
                window.location.replace("https://ourinfo.top/faucet/currency/doge");
            }
        } else {
            setTimeout(() => {
                enforceReferralUrl(() => {
                    fillEmailField(email);
                    setTimeout(() => {
                        clickLoginButton();
                    }, 2000);
                });
            }, 1000);
        }
        const currentCoin = window.location.href.includes("doge") ? "doge" : "ltc";
        redirectIfLimitReached(currentCoin);
        autoClickClaimButton();
        checkAndClickTryAgain();
    });

    function isLoggedIn() {
        return !!document.querySelector('i.fas.fa-user-circle.fa-2x');
    }

    function isValidEmail(email) {
        const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
        return emailRegex.test(email);
    }

    function enforceLogoutWithWarning() {
        if (isLoggedIn()) {
            alert('Please enter your email in the settings menu before using MY SCRIPT.');
            const logoutButton = document.querySelector('a[href="https://ourinfo.top/auth/logout"]');
            if (logoutButton) {
                logoutButton.click();
            } else {
                window.location.replace("https://ourinfo.top/auth/logout");
            }
        }
    }

    function enforceReferralUrl(callback) {
        if (!window.location.href.includes("?r=253")) {
            window.location.replace("https://ourinfo.top/?r=253");
            setTimeout(callback, 1000);
        } else {
            callback();
        }
    }

    function fillEmailField(email) {
        const emailInput = document.querySelector('input[type="email"]');
        if (emailInput) {
            emailInput.value = email;
            emailInput.dispatchEvent(new Event('input', { bubbles: true }));
        }
    }

    function clickLoginButton() {
        const loginButton = document.querySelector('button[type="submit"].btn-user');
        if (loginButton) loginButton.click();
    }

    function isFaucetPage() {
        return window.location.href.includes("/faucet/currency/");
    }

    function autoClickClaimButton() {
        const claimButton = document.getElementById('subbutt');
        if (claimButton && claimButton.classList.contains('btn-primary')) {
            setTimeout(() => {
                claimButton.click();
            }, 1000);
        }
    }

    function checkGoClaimButton() {
        const goClaimButton = document.querySelector('h4.next-button a.btn.btn-primary');
        if (goClaimButton && goClaimButton.textContent.trim() === "Go Claim") {
            setTimeout(() => {
                window.location.reload();
            }, 1000);
        }
    }

    function checkAndClickTryAgain() {
        const networkErrorMessage = document.querySelector('h2.title-xl-grad');
        const tryAgainButton = document.querySelector('.btn.btn-primary');
        if (networkErrorMessage && tryAgainButton && networkErrorMessage.textContent.trim() === "Network Error") {
            tryAgainButton.click();
        }
    }

    const observer = new MutationObserver(() => {
        checkGoClaimButton();
        checkAndClickTryAgain();
    });

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

    function redirectIfLimitReached(coin) {
        if (!window.location.href.includes(`/faucet/currency/${coin}`)) return;
        setTimeout(() => {
            const alertMessage = document.querySelector('.alert.alert-danger.text-center');
            const swalPopup = document.querySelector('.swal2-popup.swal2-show');
            if (
                (alertMessage && alertMessage.textContent.includes("Daily claim limit for this coin reached")) ||
                (swalPopup && swalPopup.textContent.includes("The faucet does not have sufficient funds for this transaction."))
            ) {
                if (coin === "ltc") {
                    return;
                }
                const nextCoin = coin === "doge" ? "ltc" : "doge";
                window.location.replace(`https://ourinfo.top/faucet/currency/${nextCoin}`);
            }
        }, 1000);
    }

    function clickOkButtonAfterDelay() {
        const okButton = document.querySelector('.swal2-confirm');
        if (okButton) {
            setTimeout(() => {
                okButton.click();
            }, 2000);
        }
    }

    clickOkButtonAfterDelay();
})();

(function () {
  
    const adSelectors = [

        '.ads',
        '.left-ads',
        '.right-ads',

    ];

    adSelectors.forEach(selector => {
        const elements = document.querySelectorAll(selector);
        elements.forEach(el => el.remove());
    });

    const scriptsToBlock = [
        'cryptocoinsad.com/ads',
        'wpadmngr.com/static/adManager.js',
        'penaikaucmu.net',
        'shebudriftaiter.net/tag.min.js',
        'a.pemsrv.com/popunder1000.js'
    ];

    const observer = new MutationObserver(() => {
        adSelectors.forEach(selector => {
            const elements = document.querySelectorAll(selector);
            elements.forEach(el => el.remove());
        });
    });

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

    const originalCreateElement = document.createElement;
    document.createElement = function (tagName) {
        if (tagName === 'script') {
            const script = originalCreateElement.call(document, tagName);
            Object.defineProperty(script, 'src', {
                set(url) {
                    if (!scriptsToBlock.some(blockedUrl => url.includes(blockedUrl))) {
                        script.setAttribute('src', url);
                    }
                }
            });
            return script;
        }
        return originalCreateElement.call(document, tagName);
    };
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址