Greasy Fork

99faucet

Faucet claim

目前为 2024-05-08 提交的版本。查看 最新版本

// ==UserScript==
// @name         99faucet
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Faucet claim
// @author       Gysof
// @match        https://99faucet.com/*
// @icon         https://99faucet.com/matic.png
// @grant        none
// ==/UserScript==

// Register here - https://99faucet.com/?r=3396
// You will need Recaptcha solver - link - https://chromewebstore.google.com/detail/rektcaptcha-recaptcha-sol/bbdhfoclddncoaomddgkaaphcnddbpdh
// Editar email e pass linha 21 - 22
// Reivindicar faucet a cada 1 minutos em (Free Faucet) ou sem tempo em (Unlimited Faucet)

(function() {
    'use strict';

    // Editar email e senha
    const email = "Your@Email"; // Substitua com seu email
    const senha = "YouPassword"; // Substitua com sua senha

    let botaoClicado = false;

    function esperarElemento(selector, callback) {
        const elemento = document.querySelector(selector);
        if (elemento) {
            callback(elemento);
        } else {
            setTimeout(() => {
                esperarElemento(selector, callback);
            }, 500);
        }
    }

    function esperarReCaptcha(callback) {
        let intervalo = setInterval(() => {
            if (document.getElementsByClassName('g-recaptcha').length !== 0 && window.grecaptcha.getResponse().length !== 0) {
                clearInterval(intervalo);
                callback();
            }
        }, 1000);
    }

    function invocarReCaptcha(seletor, tempo) {
        if (document.getElementsByClassName('g-recaptcha').length !== 0) {
            let formulario = document.getElementsByClassName('g-recaptcha')[0].closest('form');
            esperarReCaptcha(() => submeterFormulario(formulario, 2));
        } else {
            submeterFormulario(seletor, tempo);
        }
    }

    function submeterFormulario(seletor, tempo) {
        setTimeout(() => {
            const formulario = document.querySelector(seletor);
            if (formulario) {
                formulario.submit();
            }
        }, tempo * 1000);
    }

    function clicarBotaoLogin() {
        const botaoLogin = document.querySelector('.btn-submit.w-100');
        if (botaoLogin) {
            botaoLogin.click();
        }
    }

    function clicarBotaoReivindicar() {
        const botaoReivindicar = document.querySelector('.btn.clbtn.btn-lg.text-white.claim-button');
        if (botaoReivindicar) {
            botaoReivindicar.click();
            botaoClicado = true;
        }
    }

    function recarregarAposClique() {
        if (!botaoClicado) {
            setTimeout(() => {
                location.reload();
            }, 60000);
        }
    }

    function verificarBotaoReivindicar() {
        let intervalo = setInterval(() => {
            const botaoReivindicar = document.querySelector('.btn.clbtn.btn-lg.text-white.claim-button');
            if (botaoReivindicar) {
                clearInterval(intervalo);
                botaoReivindicar.click();
            }
        }, 1000);
    }

    function autoLogin() {
        esperarElemento('input[type="email"]', (campoEmail) => {
            campoEmail.focus();
            campoEmail.value = email;

            esperarElemento('input[type="password"]', (campoSenha) => {
                campoSenha.focus();
                campoSenha.value = senha;

                invocarReCaptcha('form', 2);

                esperarReCaptcha(() => clicarBotaoLogin());
            });
        });
    }

    function autoReivindicar() {
        invocarReCaptcha('form', 2);

        esperarReCaptcha(() => {
            verificarBotaoReivindicar();
            recarregarAposClique();
        });
    }

    if (window.location.href === "https://99faucet.com/notimer") {
        window.addEventListener('load', () => {
            esperarElemento('form', () => {
                invocarReCaptcha('form', 2);
              
                esperarReCaptcha(() => {
                    let intervalo = setInterval(() => {
                        const botaoReivindicar = document.querySelector('.btn.clbtn.btn-lg.text-white.claim-button');
                        if (botaoReivindicar) {
                            botaoReivindicar.click();
                        }
                    }, 1000);
                });
            });
        });
    }

    if (window.location.href === "https://99faucet.com/") {
        window.location.href = "https://99faucet.com/login";
    }

    if (window.location.href === "https://99faucet.com/dashboard") {
        window.location.href = "https://99faucet.com/faucet";
    }

    if (window.location.href === "https://99faucet.com/login") {
        window.addEventListener('load', autoLogin);
    }

    if (window.location.href === "https://99faucet.com/faucet") {
        window.addEventListener('load', autoReivindicar);
    }

})();