Cryptofuture auto faucet

Automatically Login and Click Faucet on Cryptofuture

当前为 2024-10-16 提交的版本,查看 最新版本

在您安装前,Greasy Fork 希望您知道此脚本声明其包含了一些负面功能。这些功能也许会使脚本作者获利,而不能给您带来任何直接的金钱收益。

作者可从这份脚本获得佣金,例如通过修改链接地址或提供优惠券代码以包含推荐或附属代码。 脚本作者的说明: Directs to a referral link when not logged in

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Cryptofuture auto faucet
// @namespace    bekerja pada tampermonkey maupun violentmonkey
// @version      0.6
// @description  Automatically Login and Click Faucet on Cryptofuture
// @author       Ojo Ngono
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @require      https://update.greasyfork.org/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
// @match        https://cryptofuture.co.in/*
// @license      Copyright OjoNgono
// @antifeature  referral-link Directs to a referral link when not logged in
// ==/UserScript==

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

(function() {
    'use strict';
    window.addEventListener('load', () => {
        startProcess();
    });

    function startProcess() {
        const email = cfg.get('Email');
        if (!email || email.trim() === '') {
            enforceLogoutWithWarning();
            return;
        } else {
            enforceReferralUrl();
            setTimeout(() => {
                if (!isLoggedIn()) {
                    clickLoginJoinButton();
                } else {
                    fillEmailField(email);
                    rotateUrls();
                    enforceReferralUrl();
                    observeTurnstileAndClaim();
                }
            }, 1000);
        }
    }

    function isLoggedIn() {
        const logoutMenuItem = document.querySelector('a[href="https://cryptofuture.co.in/auth/logout"]');
        const alertMessage = document.querySelector('.alert.alert-info.text-center');
        return logoutMenuItem !== null || alertMessage !== null;
    }

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

    function enforceReferralUrl() {
        const email = cfg.get('Email');
        if (!isLoggedIn() && email) {
            const currentUrl = window.location.href;
            const referralUrl = "https://cryptofuture.co.in/?r=43940";
            if (currentUrl === "https://cryptofuture.co.in/" && !currentUrl.includes("?r=43940")) {
                window.location.replace(referralUrl);
            }
        }
    }

    function clickLoginJoinButton() {
    const loginButton = document.querySelector('.btn.btn-success.btn-lg[data-bs-target="#claimModal"]');
    if (loginButton) {
        loginButton.click();
    }
    setTimeout(() => {
        const email = cfg.get('Email');
        fillEmailField(email);
        observeTurnstileAndClaim();
    }, 1000);
}


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

    function observeTurnstileAndClaim() {
    const turnstileObserver = new MutationObserver(() => {
        const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
        const claimNowButton = document.querySelector('#subbutt');
        const modalSubmitButton = document.querySelector('.btn.btn-primary.btn-user.btn-block');

        if (turnstileResponse && turnstileResponse.value !== "") {
            if (claimNowButton) {
                claimNowButton.scrollIntoView({ behavior: 'smooth', block: 'center' });
                claimNowButton.click();
            }
            if (modalSubmitButton) {
                modalSubmitButton.scrollIntoView({ behavior: 'smooth', block: 'center' });
                modalSubmitButton.click();
            }
            turnstileObserver.disconnect();
        }
    });

    const turnstileInput = document.querySelector('input[name="cf-turnstile-response"]');
    if (turnstileInput) {
        turnstileObserver.observe(turnstileInput, { attributes: true, attributeFilter: ['value'] });
    }

    setTimeout(() => {
        const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
        const claimNowButton = document.querySelector('#subbutt');
        const modalSubmitButton = document.querySelector('.btn.btn-primary.btn-user.btn-block');

        if (turnstileResponse && turnstileResponse.value === "" && claimNowButton && claimNowButton.innerText.includes('Claim Now')) {
            claimNowButton.click();
        }
        if (modalSubmitButton) {
            modalSubmitButton.click();
        }
    }, 30000);
}


    const urls = [
        "https://cryptofuture.co.in/faucet/currency/ltc",
        "https://cryptofuture.co.in/faucet/currency/doge",
        "https://cryptofuture.co.in/faucet/currency/usdt",
        "https://cryptofuture.co.in/faucet/currency/dgb",
        "https://cryptofuture.co.in/faucet/currency/sol",
        "https://cryptofuture.co.in/faucet/currency/trx",
        "https://cryptofuture.co.in/faucet/currency/bnb",
        "https://cryptofuture.co.in/faucet/currency/dash",
        "https://cryptofuture.co.in/faucet/currency/eth",
        "https://cryptofuture.co.in/faucet/currency/fey",
        "https://cryptofuture.co.in/faucet/currency/sol",
        "https://cryptofuture.co.in/faucet/currency/zec"
    ];
    let currentIndex = parseInt(localStorage.getItem('currentIndex')) || 0;

    const rotateUrls = () => {
        if (window.location.href === "https://cryptofuture.co.in/dashboard") {
            window.location.href = urls[currentIndex];
            currentIndex = (currentIndex + 1) % urls.length;
            localStorage.setItem('currentIndex', currentIndex);
        }
    };

    function checkForMessage() {
        const swalPopup = document.querySelector('.swal2-popup.swal2-show');
        if (swalPopup) {
            const successMessageContainer = swalPopup.querySelector('.swal2-html-container');
            if (successMessageContainer) {
                const successMessage = successMessageContainer.innerText || "";
                const successIndicator = "has been sent to your FaucetPay account!";
                const claimSuccessIndicator = "Success!";
                const insufficientFundsMessage = "The faucet does not have sufficient funds for this transaction.";
                if (successMessage.includes(successIndicator) || successMessage.includes(claimSuccessIndicator)) {
                    window.location.href = "https://cryptofuture.co.in/dashboard";
                } else if (successMessage.includes(insufficientFundsMessage)) {
                    window.location.href = "https://cryptofuture.co.in/dashboard";
                }
            }
        }
    }

    setInterval(checkForMessage, 1000);
})();