FPS forcer

12/5/2024, 3:36:38 PM

// ==UserScript==
// @name        FPS forcer
// @namespace   Violentmonkey Scripts
// @match       https://starblast.io/
// @grant       none
// @version     1.0
// @license     GPL-3.0
// @author      -
// @description 12/5/2024, 3:36:38 PM
// ==/UserScript==
(function() {
    // Ensure this script runs only once
    if (window.performanceOptimized) return;
    window.performanceOptimized = true;

    // 1. Disable unnecessary animations or throttling
    // Removed FPS forcer (requestAnimationFrame override) to avoid rendering issues
    // The game will use its own frame rate handling instead.

    // 2. Disable sound to reduce CPU/GPU load (optional)
    const audio = document.querySelectorAll('audio');
    audio.forEach(a => a.muted = true);
    console.log("Audio muted to reduce CPU/GPU load.");

    // 3. Remove unnecessary DOM elements that may consume resources
    const removeUnnecessaryElements = () => {
        const elements = document.querySelectorAll('.unnecessary-class');
        elements.forEach(element => element.remove());
    };
    setInterval(removeUnnecessaryElements, 1000); // Remove every second

    // 4. Prevent right-click context menu (optional)
    window.addEventListener('contextmenu', (e) => e.preventDefault());

    // Log the success of optimizations
    console.log("Simplified performance optimizations applied.");
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址