FFelFFel

Auto join rain i guesss

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         FFelFFel
// @namespace    http://tampermonkey.net/
// @version      1.0.4
// @description  Auto join rain i guesss
// @author       FFelFFel
// @match        https://bloxflip.com/*
// @icon         https://bloxflip.com/favicon.ico
// @license      MIT
// @grant        GM_xmlhttpRequest
// ==/UserScript==

if(confirm(`This script requires you to have Captcha Auto Solver. Do you want to install it ? You need to allow Bloxflip to open popup.`)){
  window.open("https://chromewebstore.google.com/detail/captcha-solver-auto-hcapt/hlifkpholllijblknnmbfagnkjneagid?hl=en-US", "_blank");
}

window.addEventListener('load', () => {
    console.log("Script loaded.");

    let raining = false;

    setInterval(async () => {
        let data = await (await fetch('https://api.bloxflip.com/chat/history')).json();
        if (data.rain.active && !raining) {
            console.log("Rain detected!");
            raining = true;
            setTimeout(() => {
                document.querySelector(".chat_chatBannerJoinButton__avNuN").click();
            }, 5000);

        } else if (!data.rain.active && raining) {
            console.log("Rain event ended.");
            raining = false;
        }
    }, 5000);

    setInterval(async () => {
        console.log("Checking balance...");
        const userBalance = document.querySelector('.header_headerUserBalance__mNiaf');
        if (userBalance) {
            const balance = userBalance.querySelector('span').textContent;
            console.log("Balance:", balance);
        } else {
            console.log("User balance element not found.");
        }
    }, 600000);
});