您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
旋转的五分硬币直播间深渊排队脚本
当前为
// ==UserScript== // @name 旋转的五分硬币排队 // @namespace http://tampermonkey.net/ // @version 0.0.4 // @description 旋转的五分硬币直播间深渊排队脚本 // @author Mimiko // @license MIT // @match *://live.bilibili.com/3140454* // @match *://live.bilibili.com/743364* // @icon http://i0.hdslb.com/bfs/activity-plat/static/20211202/dddbda27ce6f43bf18f5bca141752a99/fCo7evLooK.webp@128w // @grant GM_xmlhttpRequest // ==/UserScript== // With lots of thx to Rexze // http://greasyfork.icu/en/scripts/436443-%E6%97%8B%E8%BD%AC%E7%9A%84%E4%BA%94%E5%88%86%E7%A1%AC%E5%B8%81%E6%8E%92%E9%98%9F (() => { if (window.top !== window.self) return // variable const cacheAdd = new Set() let cacheSearch = '' const port = 9644 const speaker = new SpeechSynthesisUtterance() // function const add = async ( name, ) => { if (cacheAdd.has(name)) return cacheAdd.add(name) const data = await get(`http://localhost:${port}/add?name=${name}`) if (!data) return speak(data.message) } const get = ( url, ) => new Promise(resolve => { GM_xmlhttpRequest({ method: 'GET', url, onError: () => resolve(null), onload: (response) => resolve(JSON.parse(response.responseText)), }) }) const main = () => { window.setInterval(pick, 1e3) window.setTimeout(pauseVideo, 1e3) } const pauseVideo = () => { const $video = document.querySelector('video') if (!$video) return $video.pause() } const pick = () => { const $list = Array.from(document.querySelectorAll('.chat-history-panel .danmaku-item')).reverse() for (const $danmaku of $list) { const content = $danmaku.getAttribute('data-danmaku').trim() const name = $danmaku.getAttribute('data-uname').trim() if (content === '排队') { add(name) break } if (content === '查询排队') { search(name) break } } } const search = async ( name, ) => { console.log(name, cacheSearch) if (cacheSearch === name) return cacheSearch = name const data = await get(`http://localhost:${port}/search?name=${name}`) if (!data) return speak(data.message) } const speak = ( message, ) => { speaker.text = message window.speechSynthesis.speak(speaker) } // execute main() })()