Greasy Fork

Greasy Fork is available in English.

99faucet

Faucet claim

当前为 2024-05-13 提交的版本,查看 最新版本

// ==UserScript==
// @name         99faucet
// @namespace    http://tampermonkey.net/
// @version      1.2
// @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 23 - 24
// 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(() => {
          const elementosReCaptcha = document.getElementsByClassName('g-recaptcha');
          if (elementosReCaptcha.length !== 0) {
              const elementoReCaptcha = elementosReCaptcha[0];
              const sitekey = elementoReCaptcha.dataset.sitekey;
              if (sitekey === "6LfaznEpAAAAALyJ5hRa1p_ef3imsQdvXg6ikZch" && 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) {
            setTimeout(() => {
                botaoReivindicar.click();
                botaoClicado = true;
            }, 6000);
        }
    }

    function cx() {
        const xp = '/html/body/div[1]/div[3]/div[2]/div/div[2]/div[1]/form/button';
        const botaoReivindicar = document.evaluate(xp, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
        if (botaoReivindicar) {
            setTimeout(() => {
                botaoReivindicar.click();
                botaoClicado = true;
            }, 6000);
        }
    }

    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);
                setTimeout(() => {
                    botaoReivindicar.click();
                }, 6000);
            }
        }, 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(() => {
            clicarBotaoReivindicar();
            cx();
            recarregarAposClique();
        });
    }

    if (window.location.href === "https://99faucet.com/notimer") {
        window.addEventListener('load', () => {
            esperarElemento('form', () => {
                invocarReCaptcha('form', 2);

                esperarReCaptcha(() => {
                    let intervalo = setInterval(() => {
                        clicarBotaoReivindicar();
                        cx();
                    }, 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);
    }

})();