Maksyme / Unlimited Cryptocurrencies (FaucetClaimCoin.com)

// ==UserScript==
// @name            Unlimited Cryptocurrencies (FaucetClaimCoin.com)
// @name:fr         Cryptomonnaies illimitées (FaucetClaimCoin.com)
// @namespace       http://tampermonkey.net/
// @version         2.0
// @description     Earn unlimited free cryptocurrencies on FaucetClaimCoin.com using this script.
// @description:fr  Gagner gratuitement et sans limite de la cryptomonnaie sur FaucetClaimCoin.com en utilisant ce script.
// @author          Maksyme
// @copyright       2021, Maksyme
// @licence         MIT
// @match           https://faucetclaimcoin.com
// @match           https://faucetclaimcoin.com/*
// @icon            https://faucetclaimcoin.com/assets/img/favicon.png
// @grant           none
// ==/UserScript==

(function() {
    'use strict';

    // IF YOU HAVE ANY QUESTIONS, ASK ME! :)
    // Note: Before using this script, you need to install the hCaptcha Solver in order to solve it automatically.
    // If you have not installed already, please install the script before proceeding further. Link below:
    // https://greasyfork.org/en/scripts/425854-hcaptcha-solver
    // Credits: ngageub (https://greasyfork.org/en/users/767752-engageub).

    // Enter Your FaucetPay Faucet Address below as mentioned in the example and save the entered text in a file.
    // Example: var bitcoin="12oWM8x1mp4B99BizJnzb4bCU7uUQ3jdTL";

    var bitcoin = "12oWM8x1mp4B99BizJnzb4bCU7uUQ3jdTL";
    var bitcoincash = "bitcoincash:qqpcpwvgfesqwz92uzk3arn0dm2sxupcys5twxsq2j";
    var dogecoin = "D6tJGhJvCPhiGiyj8eJ8gFoPUiUoDSc6VR";
    var litecoin = "MJzKGT4QsGNs3YTmBdTiN7wkoVBT4oP27J";
    var digibyte = "DHcXQzN5aCrcQYdHwcPayN6CzYArzQJMZA";
    var dash = "XhjDQvF7N3a6BJ5AGqqAVbsATLJMv1b1nq";
    var tether = "THbsbujrz9JBm7a25PBsihUGz7us6vDx9e";
    var tron = "THbsbujrz9JBm7a25PBsihUGz7us6vDx9e";

    //Support me! Do not remove reflinks :) I earn 10% referral commission.
    var data = [
        {url : "https://faucetclaimcoin.com/freeBTC/?r=12oWM8x1mp4B99BizJnzb4bCU7uUQ3jdTL", coin : "BTC", address : bitcoin},
        {url : "https://faucetclaimcoin.com/freeBCH/?r=bitcoincash:qqpcpwvgfesqwz92uzk3arn0dm2sxupcys5twxsq2j", coin : "BCH", address : bitcoincash},
        {url : "https://faucetclaimcoin.com/freeDOGE/?r=D6tJGhJvCPhiGiyj8eJ8gFoPUiUoDSc6VR", coin : "DOGE", address : dogecoin},
        {url : "https://faucetclaimcoin.com/freeLTC/?r=MJzKGT4QsGNs3YTmBdTiN7wkoVBT4oP27J", coin : "LTC", address : litecoin},
        {url : "https://faucetclaimcoin.com/freeDGB/?r=DHcXQzN5aCrcQYdHwcPayN6CzYArzQJMZA", coin : "DGB", address : digibyte},
        {url : "https://faucetclaimcoin.com/freeDASH/?r=XhjDQvF7N3a6BJ5AGqqAVbsATLJMv1b1nq", coin : "DASH", address : dash},
        {url : "https://faucetclaimcoin.com/freeUSDT/?r=THbsbujrz9JBm7a25PBsihUGz7us6vDx9e", coin : "USDT", address : tether},
        {url : "https://faucetclaimcoin.com/freeTRX/?r=THbsbujrz9JBm7a25PBsihUGz7us6vDx9e", coin : "TRX", address : tron},
    ];

    var address = "";
    var nextURL = "";
    var count = 0;

    for (let value of Object.values(data)) {
        count = count + 1;
        if (window.location.href.includes("/free" + value.coin + "/")) {
            address = value.address;
            if (count == data.length) {
                count = 0;
                nextURL = data[count].url;
            } else {
                nextURL = data[count].url;
            }
            break;
        }
    }

    if (!data[count].url.includes("?r=")) {
        window.location.href = "https://www.google.com/";
        window.alert("URLs has been edited! Do not remove reflinks!");
    }

    // Set address to input.
    setTimeout(function() {
        document.querySelector("input[class=form-control]").value = address;
    }, 2000);

    // Click on claim when hCaptcha is solved.
    setInterval(function() {
        if (document.querySelector(".h-captcha > iframe").getAttribute("data-hcaptcha-response").length > 0) {
            document.getElementsByClassName("btn btn-primary btn-lg claim-button")[0].click();
        }
    }, 1000); // Note: you can edit interval if your PC is not powerful enough.

    // Go to next URL if success.
    setInterval(function() {
        if (document.querySelector(".alert.alert-success").innerText.includes("was sent to you")) {
            window.location.href = nextURL;
        }
    }, 1000); // Note: you can edit interval if your PC is not powerful enough.

    setInterval(function() {
        if ((document.querySelector(".alert.alert-danger").innerText.includes("sufficient funds"))
            || (document.querySelector(".alert.alert-danger").innerText.includes("captcha"))) {
            window.location.href = nextURL;
        }
    }, 1000); // Note: you can edit interval if your PC is not powerful enough.

    // Go to next URL if we need to wait.
    setInterval(function() {
        if (document.querySelector(".alert.alert-info") && document.querySelectorAll(".alert.alert-info")[1].innerText.includes("You have to wait")) {
            window.location.href = nextURL;
        }
    }, 1000); // Note: you can edit interval if your PC is not powerful enough.

})();