您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
监控茶水数量并提示
// ==UserScript== // @name 茶水监控提示 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 监控茶水数量并提示 // @author YourName // @match https://www.milkywayidle.com/* // @match https://test.milkywayidle.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 创建提示容器(基于原有样式调整位置) const alertContainer = document.createElement('div'); Object.assign(alertContainer.style, { position: 'fixed', top: '20%', // 调整到屏幕偏上位置 left: '50%', transform: 'translate(-50%, -50%)', fontSize: '48px', fontWeight: 'bold', color: 'rgba(255, 0, 0, 0.7)', textShadow: '2px 2px 4px rgba(0,0,0,0.5)', zIndex: 9999, pointerEvents: 'none', display: 'none' }); alertContainer.textContent = '茶快喝完了!'; document.body.appendChild(alertContainer); // 检测消耗品数量 function checkConsumables() { const slots = document.querySelectorAll('.ConsumableSlot_consumableSlotContainer__2DwgD'); let hasEmpty = false; slots.forEach(slot => { const countElement = slot.querySelector('.Item_count__1HVvv'); if (countElement && parseInt(countElement.textContent) <= 20) { hasEmpty = true; } }); alertContainer.style.display = hasEmpty ? 'block' : 'none'; } // 每2秒检测一次 setInterval(checkConsumables, 2000); checkConsumables(); // 初始检测 })();