您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a shared rainbow effect to the name, level, and the word 'level' in Bonk.io, visible to other users with this script.
当前为
// ==UserScript== // @name Bonk.io Color Change Command // @namespace http://tampermonkey.net/ // @version 15.7.8 // @match *://bonk.io/* // @grant GM_addStyle // @description Adds a shared rainbow effect to the name, level, and the word 'level' in Bonk.io, visible to other users with this script. // ==/UserScript== // Listen for chat input to change colors document.addEventListener('keydown', function (e) { if (e.key === 'Enter') { // Check if the Enter key is pressed (for chat) setTimeout(() => { // Wait for chat message to be input let chatInput = document.querySelector('input[type="text"]'); if (!chatInput) return; let message = chatInput.value.trim(); if (message.startsWith('/color')) { let args = message.split(' '); // Split command and arguments let colorCommand = args[1]; if (colorCommand) { // Apply the color or rainbow effect based on the command if (colorCommand === 'rainbow') { applyRainbowEffect(); } else { applyColor(colorCommand); } } } }, 100); } }); // Function to apply a single color to the player name and level function applyColor(color) { GM_addStyle(` #player-name, #player-level, .level-text { color: ${color} !important; } `); console.log(`Changed name and level color to ${color}`); } // Function to apply a rainbow effect to the player name and level function applyRainbowEffect() { GM_addStyle(` #player-name, #player-level, .level-text { color: red; animation: rainbow 3s infinite; } @keyframes rainbow { 0% { color: red; } 14% { color: orange; } 28% { color: yellow; } 42% { color: green; } 57% { color: blue; } 71% { color: indigo; } 85% { color: violet; } 100% { color: red; } } `); console.log('Applied rainbow effect to name and level'); }