Keran and Bagi auto faucet

input Email for automate faucet interactions

目前為 2024-06-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Keran and Bagi auto faucet
// @namespace    auto faucet
// @version      0.1
// @description  input Email for automate faucet interactions
// @author       You
// @match        https://bagi.co.in/*
// @match        https://keran.co/*
// @grant        unsafeWindow
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_addStyle
// @grant        GM_xmlhttpRequest
// @grant        window.onurlchange
// @grant        GM_registerMenuCommand
// @require      https://update.gf.qytechs.cn/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
// @license      Copyright OjoNgono
// ==/UserScript==
 
(function() {
    'use strict';
 
    const cfg = new MonkeyConfig({
        title: 'FaucetPay Configuration',
        menuCommand: true,
        params: {
            Email: {
                label: "EmailFaucetpay",
                type: "text",
                default: ''
            },
        }
    });
 
    const email = cfg.get('Email'); 
    const bagiReferralId = '65307'; 
    const keranReferralId = '69657'; 
    const siteA = 'https://bagi.co.in';
    const siteB = 'https://keran.co';
    let currentSite = window.location.href.includes('bagi.co.in') ? siteA : siteB;
    let currentReferralId = window.location.href.includes('bagi.co.in') ? bagiReferralId : keranReferralId;
 
    function onDocumentReady(fn) {
        if (document.readyState !== "loading") {
            fn();
        } else {
            document.addEventListener("DOMContentLoaded", fn);
        }
    }
 
    function isAltchaChecked() {
        const altchaCheckbox = document.getElementById('altcha_checkbox');
        return altchaCheckbox && altchaCheckbox.checked;
    }
 
    function isReCAPTCHAChecked() {
        const recaptchaCheckbox = document.querySelector('.g-recaptcha-response');
        return recaptchaCheckbox && recaptchaCheckbox.value.trim().length > 0;
    }
 
    function clickCheckbox() {
        const checkbox = document.querySelector('input[type="checkbox"]');
        if (checkbox && !checkbox.checked) {
            checkbox.click();
        }
    }
 
    const interval = setInterval(() => {
        if (document.querySelector('input[type="checkbox"]') !== null) {
            clickCheckbox();
            clearInterval(interval);
        }
    }, 2000);
 
    function clickModalButton() {
        let modalButton = document.querySelector("button[data-target='#myModal']");
        if (modalButton) {
            modalButton.click();
        }
    }
 
    function clickSubmitButton() {
        let submitButton = document.querySelector("button[type='submit']");
        if (submitButton && isAltchaChecked()) {
            submitButton.click();
        }
    }
 
    function clickClaimNowButton() {
        let buttons = document.querySelectorAll("button.button.is-info[type='submit']");
        for (let button of buttons) {
            if (button.textContent.trim() === 'Claim Now!') {
                button.click();
                return true;
            }
        }
        return false;
    }
 
    function redirectToAlternateSite() {
        if (currentSite === siteA) {
            window.location.href = siteB;
        } else {
            window.location.href = siteA;
        }
    }
 
    onDocumentReady(function() {
 
        let login = setInterval(function() {
            let card_md = document.querySelector("#myModal.is-active");
            let emailfield = document.querySelector("input[type='email']");
            let button = document.querySelector("button[type='submit']");
            if (card_md && emailfield && emailfield.value !== email) {
                emailfield.value = email;
            }
            if (emailfield.value === email && isReCAPTCHAChecked()) {
                button.click();
                clearInterval(login);
            }
        }, 5000);
 
        if (window.location.href.includes('captha')) {
            let claim = setInterval(function() {
                clickModalButton();
                clickSubmitButton();
                if (document.querySelector("button[type='submit']")) {
                    setTimeout(function() { window.location.reload(); }, 50000);
                    clearInterval(claim);
                }
            }, 5000);
 
            let claim2 = setInterval(function() {
                let altcha = document.querySelector("input[name='cf-altcha-response']");
                clickModalButton();
                clickSubmitButton();
                if (document.querySelector("button[type='submit']") && altcha && altcha.value.length > 0) {
                    setTimeout(function() { window.location.reload(); }, 60000);
                    clearInterval(claim2);
                }
            }, 5000);
        }
 
        if (window.location.href.includes('faucet')) {
            setTimeout(function() {
                if (!clickClaimNowButton()) {
                    redirectToAlternateSite();
                }
                setTimeout(function() { window.location.reload(); }, 60000);
            }, 5000);
            setTimeout(function refresh() {
                window.location.reload();
            }, 600000 + Math.floor(Math.random() * 60000) + 20000); 
        }
 
        if (window.location.href.includes('dashboard')) {
            setTimeout(function() {
                location.href = 'faucet.php';
            }, 5000);
        }
 
        if (window.location.href === siteA || window.location.href === (siteA + '/') || window.location.href === (siteA + '/index.php') ||
            window.location.href === siteB || window.location.href === (siteB + '/') || window.location.href === (siteB + '/index.php')) {
            setTimeout(function() {
                if (location.search !== `?ref=${currentReferralId}`) {
                    location.search = `?ref=${currentReferralId}`;
                }
            }, 2000);
        }
 
        if (location.search === `?ref=${currentReferralId}`) {
            setTimeout(function() {
                clickModalButton();
                setTimeout(function() { window.location.reload(); }, 60000);
            }, 3000);
        }
 
        setTimeout(function() {
            let alertMsg = document.querySelector("div.message-body");
            if (alertMsg && alertMsg.innerText.includes("was sent")) {
                location.reload();
            }
        }, 5000);
 
    });
 
})();

QingJ © 2025

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