FFelFFel

Auto join rain i guesss

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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.

(I already have a user style manager, let me install it!)

// ==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);
});