您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Tracks your current Bilge Dice streak. Does not work across multiple devices.
当前为
// ==UserScript== // @name GC Bilge Dice Tracker // @namespace https://greasyfork.org/en/users/1175371/ // @version 0.1 // @description Tracks your current Bilge Dice streak. Does not work across multiple devices. // @author sanjix // @match https://www.grundos.cafe/games/bilgedice/* // @icon https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe // @grant none // ==/UserScript== var streakCount = JSON.parse(localStorage.getItem('BilgeDiceStreakCounter')) || 0; var game = document.querySelector('#bilge-dice-wrapper'); var counterValue = document.createElement('p'); var headerText = document.createElement('h4'); headerText.textContent = 'Current Streak:'; headerText.classList.add('bilgeTracker'); counterValue.textContent = streakCount; counterValue.classList.add('bilgeTracker'); headerText.style.marginBottom = '5px'; counterValue.style.marginTop = '5px'; game.after(counterValue); counterValue.before(headerText); function updateCounter(streakContinueBool) { if (streakContinueBool) { streakCount += 1; } else { streakCount = 0; } counterValue.textContent = streakCount; localStorage.setItem('BilgeDiceStreakCounter', JSON.stringify(streakCount)); } if (document.evaluate( "count(//div[@id='bilge-dice-wrapper']//p[contains(.,'You won!')]) > 0", document, null, XPathResult.BOOLEAN_TYPE, null ).booleanValue) { updateCounter(true) } else if (document.evaluate( "count(//div[@id='bilge-dice-wrapper']//p[contains(.,'You tied.')]) > 0", document, null, XPathResult.BOOLEAN_TYPE, null ).booleanValue) { updateCounter(true); } else if (document.evaluate( "count(//div[@id='bilge-dice-wrapper']//p[contains(., 'Oh no!')]) > 0", document, null, XPathResult.BOOLEAN_TYPE, null ).booleanValue) { updateCounter(false); } else if (document.evaluate( "count(//div[@id='bilge-dice-wrapper']//p[contains(., 'lose')]) > 0", document, null, XPathResult.BOOLEAN_TYPE, null ).booleanValue) { updateCounter(false); }