Coinmedia.in/ auto faucet

Automatically Login and Handle Faucet Pages

在您安裝前,Greasy Fork希望您了解本腳本包含“負面功能”,可能幫助腳本的作者獲利,而不能給你帶來任何收益。

作者從這份腳本獲得佣金, 例如透過重寫連結或提供優惠券代碼以加入推薦或附屬代碼 腳本的作者解釋: Directs to a referral link when not logged in

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Coinmedia.in/ auto faucet
// @namespace    bekerja pada tampermonkey maupun violentmonkey
// @version      0.2
// @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.greasyfork.org/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
// @match        https://coinmedia.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';

    const savedEmail = cfg.get('Email');

    if (!savedEmail) {
        alert("Silakan masukkan Email Faucetpay di menu pengaturan untuk melanjutkan.");
        return;
    }

    const fillEmail = () => {
        const emailInput = document.querySelector('input[placeholder="Connect Your FaucetPay Email"]');
        if (emailInput) {
            emailInput.value = savedEmail;
        }
    };

    const waitAndClickButton = () => {
        const interval = setInterval(() => {
            const button = document.querySelector('button.btn.btn-danger');
            if (button) {
                if (!button.disabled) {
                    button.click();
                    clearInterval(interval);
                }
            }
        }, 500);
    };

    const checkForMessageAndRedirect = () => {
    const swalTitle = document.querySelector('.swal2-title');
    const swalContent = document.querySelector('.swal2-html-container');
    const successMessage = "Your wallet was successfully linked";
    const insufficientFundsMessage1 = "The faucet does not have sufficient funds for this transaction.";
    const insufficientFundsMessage2 = "You are sending an invalid amount of payment to the user.";
    const insufficientFundsMessage3 = "You have been rate-limited. Please try again in a few seconds.";

    const urls = [
        "https://coinmedia.in/auto/currency/ltc",
        "https://coinmedia.in/auto/currency/bnb",
        "https://coinmedia.in/auto/currency/bch",
        "https://coinmedia.in/auto/currency/dash",
        "https://coinmedia.in/auto/currency/doge",
        "https://coinmedia.in/auto/currency/dgb",
        "https://coinmedia.in/auto/currency/eth",
        "https://coinmedia.in/auto/currency/fey",
        "https://coinmedia.in/auto/currency/trx",
        "https://coinmedia.in/auto/currency/usdt",
        "https://coinmedia.in/auto/currency/sol",
        "https://coinmedia.in/auto/currency/xrp",
        "https://coinmedia.in/auto/currency/xlm",
        "https://coinmedia.in/auto/currency/ada",
        "https://coinmedia.in/auto/currency/usdc",
        "https://coinmedia.in/auto/currency/zec",
        "https://coinmedia.in/auto/currency/xmr"
    ];

    if (swalTitle && swalTitle.innerText === "Success!" && swalContent && swalContent.innerText.includes(successMessage)) {
        window.location.href = urls[0];
        return;
    }

    if (swalContent && (swalContent.innerText.includes(insufficientFundsMessage1) || swalContent.innerText.includes(insufficientFundsMessage2) || swalContent.innerText.includes(insufficientFundsMessage3))) {
        const currentPath = window.location.pathname;
        const currentIndex = urls.findIndex(url => url.includes(currentPath.split('/').pop()));

        if (currentIndex >= 0 && currentIndex < urls.length - 1) {
            window.location.href = urls[currentIndex + 1];
        }
    }
};

    const checkTurnstile = () => {
        let turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
        return turnstileResponse && turnstileResponse.value !== '';
    };

    const checkTurnstileAndUnlock = () => {
        if (window.location.href === "https://coinmedia.in/firewall") {
            const turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
            const unlockButton = document.querySelector('button[style*="background-color: #00008B"]');

            if (turnstileResponse && turnstileResponse.value !== '' && unlockButton) {
                unlockButton.click();
            }
        }
    };

    const handleDashboardRedirect = () => {
        if (window.location.href === "https://coinmedia.in/dashboard") {
            if (!window.localStorage.getItem("redirected")) {
                window.localStorage.setItem("redirected", "true");
                window.location.href = "https://coinmedia.in/?r=10245";
            }
            return;
        }

        if (window.location.href === "https://coinmedia.in/?r=10245") {
            window.localStorage.removeItem("redirected");
        }
    };

    setTimeout(() => {
        handleDashboardRedirect();

        fillEmail();

        waitAndClickButton();

        setInterval(checkForMessageAndRedirect, 2000);

       setInterval(checkTurnstileAndUnlock, 1000);
    }, 3000);
})();