Cryptofuture auto faucet

Automatically Login and Click Faucet on Cryptofuture

目前為 2024-09-30 提交的版本,檢視 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Cryptofuture auto faucet
// @namespace    bekerja pada tampermonkey maupun violentmonkey
// @version      0.2
// @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
// ==/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();
                    observeTurnstileAndClickButton();
                }
            }, 1000);
        }
    }

    function isLoggedIn() {
        const logoutMenuItem = document.querySelector('a[data-target="#logoutModal"]');
        return logoutMenuItem !== 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('a[data-bs-target="#claimModal"]');
        if (loginButton) {
            loginButton.click();
        }
        setTimeout(() => {
            const email = cfg.get('Email');
            fillEmailField(email);
            observeTurnstileAndClickButton();
        }, 1500);
    }

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

    function observeTurnstileAndClickButton() {
        const turnstileObserver = new MutationObserver(() => {
            const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
            const claimNowButton = document.querySelector('#subbutt');
            if (turnstileResponse && turnstileResponse.value !== "") {
                if (claimNowButton) {
                    claimNowButton.scrollIntoView({ behavior: 'smooth', block: 'center' });
                }
                clickAvailableButton();
                turnstileObserver.disconnect();
            }
        });
        const turnstileInput = document.querySelector('input[name="cf-turnstile-response"]');
        if (turnstileInput) {
            turnstileObserver.observe(turnstileInput, { attributes: true, attributeFilter: ['value'] });
        }
    }

    function clickAvailableButton() {
        const loginButton = document.querySelector('button[type="submit"]');
        const claimNowButton = document.querySelector('#subbutt');
        if (loginButton) {
            loginButton.click();
        } else if (claimNowButton && claimNowButton.innerText.includes('Claim Now')) {
            claimNowButton.click();
        }
    }

    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/bnb",
        "https://cryptofuture.co.in/faucet/currency/bch",
        "https://cryptofuture.co.in/faucet/currency/dash",
        "https://cryptofuture.co.in/faucet/currency/dgb",
        "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/" || window.location.href.includes("/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.";
            const invalidCaptchaMessage = "Invalid Captcha";

            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";
            }
            else if (successMessage.includes(invalidCaptchaMessage)) {
                window.location.reload();
            }
        }
    }

    const alertDanger = document.querySelector('.alert.alert-danger.text-center');
    if (alertDanger) {
        const alertMessage = alertDanger.innerText || "";
        const dailyClaimLimitMessage = "Daily claim limit for this coin reached, please comeback again tomorrow.";

        if (alertMessage.includes(dailyClaimLimitMessage)) {
            window.location.href = "https://cryptofuture.co.in/dashboard";
        }
    }

    const goClaimButton = document.querySelector('h4.next-button a.btn.btn-primary');
    if (goClaimButton && goClaimButton.innerText.includes('Go Claim')) {
        goClaimButton.click();
    }
}

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