AutoClaim [All Coins are Available (NO SHORTLINKS OPTIONS)]

Auto claim

// ==UserScript==
// @name         AutoClaim [All Coins are Available (NO SHORTLINKS OPTIONS)]
// @namespace    Terminator.Scripts
// @version      0.6
// @description  Auto claim
// @author       TERMINATOR
// @license      MIT
// @match        https://claimlitoshi.top/faucet/currency/*
// @match        https://claimlitoshi.top/firewall
// @match        https://claimlitoshi.top/
// @match        https://scripts.cs2resellers.com/ads/?litoshi
// @icon         https://www.google.com/s2/favicons?sz=64&domain=claimlitoshi.top
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const preferredCoin = "ltc"; // ltc, ada, xrp, fey
    // The script will focus on this coin every time it resolves the firewall!


    function addProgressBar() {
        var progressBar = document.createElement('div');
        progressBar.id = 'progress-bar';
        progressBar.style.height = '5px';
        progressBar.style.width = '0';
        progressBar.style.backgroundColor = 'blue';
        progressBar.style.position = 'fixed';
        progressBar.style.top = '0';
        progressBar.style.left = '0';
        progressBar.style.zIndex = '9999';
        document.body.appendChild(progressBar);
    }
    function startCountdown() {
        var progressBar = document.getElementById('progress-bar');
        var countdownElement = document.createElement('div');
        countdownElement.id = 'countdown';
        countdownElement.style.position = 'fixed';
        countdownElement.style.top = '5px';
        countdownElement.style.left = '50%';
        countdownElement.style.transform = 'translateX(-50%)';
        countdownElement.style.color = 'white';
        countdownElement.style.fontSize = '12px';
        countdownElement.style.zIndex = '9999';
        document.body.appendChild(countdownElement);
        var redirectTimeout = 60000;
        var startTime = new Date().getTime();
        function updateProgressBar() {
            var currentTime = new Date().getTime();
            var elapsedTime = currentTime - startTime;
            var remainingTime = redirectTimeout - elapsedTime;
            var progress = (elapsedTime / redirectTimeout) * 100;
            if (remainingTime <= 0) {
                progressBar.style.width = '100%';
                window.location.href = 'https://claimlitoshi.top/faucet/currency/ltc';
            } else {
                progressBar.style.width = progress + '%';
                countdownElement.textContent = Math.ceil(remainingTime / 1000);
            }
        }
        setInterval(updateProgressBar, 1000);
    }
    function handleCaptchaAndSubmit() {
        setTimeout(function() {
            document.getElementById("fauform").submit();
        }, 3000);
    }
    function redirectToNextCoin() {
        switch (window.location.href) {
            case "https://claimlitoshi.top/faucet/currency/ltc":
                window.location.replace("https://claimlitoshi.top/faucet/currency/ada");
                break;
            case "https://claimlitoshi.top/faucet/currency/ada":
                window.location.replace("https://claimlitoshi.top/faucet/currency/xrp");
                break;
            case "https://claimlitoshi.top/faucet/currency/xrp":
                window.location.replace("https://claimlitoshi.top/faucet/currency/fey");
                break;
            case "https://claimlitoshi.top/faucet/currency/fey":
                window.location.replace("https://scripts.cs2resellers.com/ads/?litoshi");
                break;
            case "https://scripts.cs2resellers.com/ads/?litoshi":
                window.location.replace("https://claimlitoshi.top/faucet/currency/ltc");
                break;
            default:
                window.location.replace("https://claimlitoshi.top/faucet/currency/" + preferredCoin);
        }
    }
    function clickClaimNow() {
        var claimButton = document.getElementById('subbutt');
        if (claimButton) {
            claimButton.click();
            handleCaptchaAndSubmit();
        } else if (window.location.href.includes("https://claimlitoshi.top/firewall")) {
            waitForCaptchaAndUnlock();
        } else if (window.location.href.includes("https://claimlitoshi.top/")) {
            redirectToNextCoin();
        } else if (window.location.href.includes("https://scripts.cs2resellers.com/ads/?litoshi")) {
            addProgressBar();
            startCountdown();
        }
    }
    function waitForCaptchaAndUnlock() {
        var unlockButton = document.querySelector('.btn.btn-primary.w-md');
        if (unlockButton) {
            console.log('Captcha solved. Clicking Unlock button.');
            unlockButton.click();
        } else {
            setTimeout(waitForCaptchaAndUnlock, 1000);
        }
    }
    setInterval(function() {
        clickClaimNow();
    }, 10000);
})();