Allfaucet.xyz (♍)

Allfaucet Manual AntiBotLinks with auto-redirect

// ==UserScript==
// @name         Allfaucet.xyz (♍)
// @namespace    https://tamperemonkey.net/
// @version      1.7
// @description  Allfaucet Manual AntiBotLinks with auto-redirect
// @author       TIJUSLEMON
// @license      Copyright - TIJUSLEMON
// @match        https://allfaucet.xyz/*
// @grant        none
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// @run-at       document-start
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);

(function() {
    'use strict';

    let antibotFinished = false;
    
    function redirectToNextUrl() {
        if (!antibotFinished) {
            console.log("Menunggu antibot selesai...");
            return;
        }
        
        const currentUrl = window.location.href;
        if (currentUrl === "https://allfaucet.xyz/dashboard") {
            window.location.href = "https://allfaucet.xyz/faucet/currency/trx";
            return;
        }
        
        const urls = [
            "trx", "fey", "ltc", "bch", "dash", "doge", "dgb", "bnb", "sol", "zec"
        ];
        for (let i = 0; i < urls.length; i++) {
            if (currentUrl.includes(`/faucet/currency/${urls[i]}`)) {
                const nextUrl = urls[(i + 1) % urls.length];
                setTimeout(() => {
                    window.location.href = `https://allfaucet.xyz/faucet/currency/${nextUrl}`;
                }, 1000);
                break;
            }
        }
    }

    const $ = window.jQuery;
    const resizeSmallQ = 1;

    const cl = text => {
        const cssRule = "border-left: 3px solid #f1b44c; padding-left: 5px; ";
        setTimeout(console.log.bind(console, "%c" + text, cssRule), 0);
    };

    $(document).ready(function() {
        setTimeout(function() {
            const ablQImg = $("#antibotlinks_reset").prev("img").attr("src");
            const ablTmp = new Image();
            ablTmp.src = ablQImg;
            const ablQWidth = ablTmp.width;
            const ablQHeight = ablTmp.height;
            let myHeightQ = 35;
            let myHeightB = 50;

            if (resizeSmallQ && ablQWidth < 150) myHeightQ *= 1.3;

            const ablBtnData = [];
            let ablClicks = 0;

            $("#antibotlinks").closest('form').find('a').each(function() {
                const rel = $(this).attr('rel');
                const img = $(this).find("img").attr("src");
                if (rel > 0 && img.length > 0) {
                    ablBtnData.push(`<img src="${img}" height="${myHeightB}" data-abl="${rel}" class="abl_btn abl_abl_hand">`);
                }
            });

            if ($("#antibotlinks").closest('form').is(":visible")) {
                cl("AntiBotLinks terlihat");

                if (!$("#i_bg").length) {
                    $("html").append(`
                    <div id="i_bg" style="position: fixed; z-index: 99999999; background-color: #212529; opacity: 0.98; top: 0; left: 0; width: 100%; height: 100%; display: none;">
                        <div id="i_box" style="position: fixed; z-index: 99999998; top: 10%; left: 50%; transform: translateX(-50%); text-align: center; font: bold 16px arial; line-height: 150%; opacity: 1; border: 1px solid #000; padding: 50px; border-radius: 10px;" class="abl_bg_light">
                            <img src="${ablQImg}" style="height: ${myHeightQ}px !important;">
                            <br><br>
                            <div style="font: 14px arial;">
                                <span class="abl_theme" style="float:left; margin: 0 20px;">Hover to THEME</span>
                                <span class="abl_reset abl_abl_hand" style="float:right; margin: 0 20px;">Click to RESET</span>
                            </div>
                            <br><br><br>
                            ${ablBtnData.join('')}
                        </div>
                    </div>
                    <style>
                        #i_box a, #i_box a:visited { line-height: 150%; font-size: 24px; color: #000; }
                        .abl_btn { margin: 0 10px; border-bottom: 1px solid #ccc; }
                        .abl_abl_hand { cursor: pointer; }
                        .abl_bg_light { background-color: #fff; color: #ccc; }
                        .abl_bg_dark { background-color: #000; color: #303030; }
                    </style>
                    `);

                    $("#i_bg").fadeIn("fast");

                    let tittle1 = document.title;
                    setInterval(() => {
                        document.title = (document.title === "BY TIJUSLEMON" ? tittle1 : "BY TIJUSLEMON");
                    }, 2000);
                }
            } else {
                cl("AntiBotLinks tidak terlihat");
            }

            $(document).on("click", "img[data-abl]", function() {
                const value = $(this).data("abl");
                if ($("#antibotlinks").val().indexOf(value) === -1) {
                    $("#antibotlinks").val($("#antibotlinks").val() + " " + value);
                }
                $(this).hide();
                ablClicks++;

                if (ablClicks === ablBtnData.length) {
                    const solution = $("#antibotlinks").val().trim();
                    console.log("Solusi yang dikirim: ", solution);
                    if (solution.length <= 1000) {
                        $("#antibotlinks").closest('form').submit();
                        $("#i_bg").fadeOut("fast");
                        $("#antibotlinks").closest('form').find("a").fadeOut();
                        $("#antibotlinks_reset").after(`<p>${solution}</p>`);
                        antibotFinished = true;
                        redirectToNextUrl();
                        
                        const notification = $("<div id='successNotification' style='border-radius:8px; position: fixed; z-index: 999999; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 1em; background: #fff; box-shadow: 0 0 1px rgba(0, 0, 0, .075); pointer-events: all; font-size: 16px; text-align: center; font-weight: bold;'>Bypassed By Tijuslemon</div>");
                        $("body").append(notification);
                        $("<style>")
                            .prop("type", "text/css")
                            .html(`
                                @keyframes shake {
                                    0% { transform: translate(-50%, -50%) translateX(-10px); }
                                    25% { transform: translate(-50%, -50%) translateX(10px); }
                                    50% { transform: translate(-50%, -50%) translateX(-10px); }
                                    75% { transform: translate(-50%, -50%) translateX(10px); }
                                    100% { transform: translate(-50%, -50%) translateX(0); }
                                }
                                #successNotification { animation: shake 0.5s ease; }
                            `)
                            .appendTo("head");

                        setTimeout(() => {
                            notification.fadeIn("slow");
                            setTimeout(() => {
                                notification.fadeOut("slow", function() {
                                    $(this).remove();
                                });
                            }, 10000);
                        }, 500);
                    } else {
                        console.log("Data terlalu banyak, tidak mengirim.");
                    }
                }
            });

            $(document).on("click", ".abl_reset", function() {
                $("#antibotlinks").val("");
                $("img[data-abl]").show();
                ablClicks = 0;
                cl("Reset berhasil, klik ulang gambar.");
            });

            $(document).on("mouseover", ".abl_theme", function() {
                $("#i_box").toggleClass("abl_bg_light abl_bg_dark");
            });

        }, 1500);
    });
})();