BloxdCyphr

Custom Script That Is Made By AI To Try How Good Is It AT MAking Bloxd Script. This Script Makes You Able To Switch Between Comic Sans Font And The Normal Font With Ctrl+Shift+X And Make The Chat Color Rainbow WIth Ctrl+Shift+Z. As An Extra, It Adds An AdBlocker And An FPS Booster!

目前為 2025-01-28 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         BloxdCyphr
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Custom Script That Is Made By AI To Try How Good Is It AT MAking Bloxd Script. This Script Makes You Able To Switch Between Comic Sans Font And The Normal Font With Ctrl+Shift+X And Make The Chat Color Rainbow WIth Ctrl+Shift+Z. As An Extra, It Adds An AdBlocker And An FPS Booster!
// @author       CyphrNX
// @match        https://bloxd.io/
// @match        https://staging.bloxd.io
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bloxd.io
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    let isComicSans = false;
    let rainbowActive = false; // Flag for rainbow effect

    // Function to optimise performance by turning off some graphics settings
    function optimizePerformance() {
        const config = {
            shadows: false,
            particles: false,
            postProcessing: false,
        };

        const optimize = () => {
            try {
                let settings = window.localStorage.getItem('settings');
                if (settings) {
                    settings = JSON.parse(settings);
                    settings.shadows = config.shadows;
                    settings.particles = config.particles;
                    settings.postProcessing = config.postProcessing;
                    window.localStorage.setItem('settings', JSON.stringify(settings));
                    console.log("Performance settings applied!");
                }
            } catch (e) {
                console.error("Failed to apply settings:", e);
            }
        };

        const modifyRendering = () => {
            requestAnimationFrame = (callback) => {
                setTimeout(callback, 0);
            };
            console.log("FPS is now boosted with no cap.");
        };

        optimize();
        modifyRendering();
    }

    // Apply rainbow effect to chat messages
    function applyRainbowEffect() {
        if (!rainbowActive) return; // Only apply rainbow if active

        const chatMessages = document.querySelectorAll('.ChatMessages div');
        chatMessages.forEach((message) => {
            message.style.animation = 'rainbow-fade 3s infinite';
            message.style.fontFamily = isComicSans ? 'Comic Sans MS, cursive' : 'Arial, sans-serif';
            message.style.fontSize = '14px';
        });
    }

    // Add rainbow animation keyframes to the page
    function addRainbowAnimation() {
        const style = document.createElement('style');
        style.innerHTML = `
            @keyframes rainbow-fade {
                0% { color: red; }
                16% { color: orange; }
                33% { color: yellow; }
                50% { color: green; }
                66% { color: blue; }
                83% { color: indigo; }
                100% { color: violet; }
            }
        `;
        document.head.appendChild(style);
    }

    // Toggle between Comic Sans and normal font
    function toggleFont(event) {
        if (event.ctrlKey && event.shiftKey && event.key === 'X') {
            isComicSans = !isComicSans;
            console.log(isComicSans ? 'Switched to Comic Sans' : 'Switched to Normal Font');
            applyRainbowEffect(); // Reapply rainbow effect to updated messages
        }
    }

    // Toggle rainbow effect on/off
    function toggleRainbow(event) {
        if (event.ctrlKey && event.shiftKey && event.key === 'Z') {
            rainbowActive = !rainbowActive;
            console.log(rainbowActive ? 'Rainbow effect activated!' : 'Rainbow effect deactivated!');
            if (rainbowActive) {
                applyRainbowEffect(); // Apply rainbow effect when activated
            }
        }
    }

    // Listen for keyboard events to switch font and rainbow effect
    window.addEventListener('keydown', (event) => {
        toggleFont(event);
        toggleRainbow(event);
    });

    // Initialise script functionalities
    function init() {
        addRainbowAnimation();
        optimizePerformance();
        setInterval(() => {
            applyRainbowEffect(); // Reapply rainbow effect to messages every second
        }, 1000);
    }

    init();
})();