您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes a sound when rain
// ==UserScript== // @name BloxFlip Rain Notification // @name:ru BloxFlip Уведомление на дожди // @namespace http://tampermonkey.net/ // @version 0.6 // @description Makes a sound when rain // @description:ru Издает звук когда начинается дождь // @author HProgram // @match https://bloxflip.com/* // @icon https://i.imgur.com/U8U9VYV.png // @license GPL-3.0-only // ==/UserScript== // Discord: Serzh1204#9186 let isRaining = false; function sleep(milliseconds) { const date = Date.now(); let currentDate = null; do { currentDate = Date.now(); } while (currentDate - date < milliseconds); } function playSound() { let audio = new Audio('https://www.myinstants.com/media/sounds/bepbob.mp3'); audio.muted = true; sleep(1000); audio.muted = false; audio.play(); } setInterval(async function() { let history = await fetch('https://api.bloxflip.com/chat/history'); let historyJson = JSON.parse(await history.text()); if (historyJson.rain.active && !isRaining) { playSound(); isRaining = true; } else if (!historyJson.rain.active && isRaining) { isRaining = false; } }, 5000);