NBTHUB / NBTHUB Auto Get Key Argon

// ==UserScript==
// @name         NBTHUB Auto Get Key Argon
// @namespace    https://pandadevelopment.net/
// @version      1.8
// @description  Automate key retrieval, handle dynamic links, and bypass linkvertise links via bypass.city
// @author       Your Name
// @match        https://pandadevelopment.net/getkey*
// @match        https://linkvertise.com/*
// @match        https://bypass.city/*
// @license      MIT
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const bypassCityURL = "https://bypass.city/bypass?bypass=";
    function handleHiddenLinks() {
        const hiddenDivs = [...document.querySelectorAll('div[style*="position: fixed"]')];
        const validLink = hiddenDivs.map(div => div.querySelector('a'))
            .find(a => a && a.href.includes('http://novemberdismount.com/sc1n6nddb'));

        if (validLink) {
            console.log("Found hidden link:", validLink.href);
            validLink.click();
            return true;
        } else {
            console.log("No valid hidden link found.");
            return false;
        }
    }
    function clickContinueButton() {
        const continueButton = [...document.querySelectorAll('button, a')].find(
            el => el.textContent.trim().toLowerCase() === 'continue'
        );

        if (continueButton) {
            console.log("Clicking the 'Continue' button...");
            continueButton.click();
        } else {
            console.log("'Continue' button not found!");
        }
    }
    function handleGetKeyPage() {
        console.log("On the getkey page!");
        setTimeout(() => {
            const hiddenLinkClicked = handleHiddenLinks();

            if (hiddenLinkClicked) {
                setTimeout(clickContinueButton, 1300);
            } else {
                clickContinueButton();
            }
        }, 1500);
    }
    function handleLinkvertisePage() {
        console.log("On linkvertise page...");

        const link = window.location.href;
        console.log("Processing linkvertise URL:", link);
        const bypassURL = bypassCityURL + encodeURIComponent(link);
        console.log("Redirecting to bypass.city:", bypassURL);
        window.location.href = bypassURL;
    }
    function handleBypassCity(linkToBypass) {
        console.log("Processing bypass.city for link:", linkToBypass);
    }
    window.addEventListener('load', () => {
        const currentURL = window.location.href;

        if (currentURL.includes('https://pandadevelopment.net/getkey')) {
            handleGetKeyPage();
        } else if (currentURL.includes('https://linkvertise.com/')) {
            handleLinkvertisePage();
        } else if (currentURL.includes('https://bypass.city/')) {
            const linkToBypass = decodeURIComponent(currentURL.split('bypass=')[1]);

            if (linkToBypass) {
                handleBypassCity(linkToBypass);
            } else {
                console.log("No link found for bypassing!");
            }
        } else {
            console.log("URL not recognized for this script.");
        }
    });
})();