Cryzen.io Lightweight Performance Boost

Optimize Cryzen.io for low-end PCs with adjustable settings for graphics and FPS.

当前为 2024-11-06 提交的版本,查看 最新版本

// ==UserScript==
// @name         Cryzen.io Lightweight Performance Boost
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  Optimize Cryzen.io for low-end PCs with adjustable settings for graphics and FPS.
// @match        https://cryzen.io/*
// @grant        none
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    console.log("Cryzen.io Lightweight Performance Boost Loaded.");

    // Define o FPS alvo (ajustável)
    const TARGET_FPS = 20;

    // Limita a taxa de quadros para o FPS alvo
    function limitFrameRate() {
        const originalRequestAnimationFrame = window.requestAnimationFrame;
        let lastCall = 0;

        window.requestAnimationFrame = function(callback) {
            const now = performance.now();
            if (now - lastCall >= 1000 / TARGET_FPS) {
                lastCall = now;
                originalRequestAnimationFrame(callback);
            } else {
                setTimeout(() => window.requestAnimationFrame(callback), 1000 / TARGET_FPS);
            }
        };
    }

    // Função para reduzir qualidade gráfica sem interferir em elementos essenciais
    function applyGraphicsOptimizations() {
        try {
            // Desativa sombras para economizar processamento
            Object.defineProperty(Object.prototype, 'castShadow', { value: false, writable: false });
            Object.defineProperty(Object.prototype, 'receiveShadow', { value: false, writable: false });

            // Desativa pós-processamento e partículas
            Object.defineProperty(Object.prototype, 'particleSystem', {
                get() { return null; },  // Remove qualquer sistema de partículas
                set() {}
            });
            Object.defineProperty(Object.prototype, 'postProcessing', {
                get() { return null; },  // Remove pós-processamento
                set() {}
            });

            console.log("Graphics optimizations applied: Shadows off, Post-processing off.");
        } catch (e) {
            console.warn("Graphics optimization error:", e);
        }
    }

    // Executa as otimizações apenas quando o jogo terminar de carregar
    function startOptimizations() {
        limitFrameRate();
        applyGraphicsOptimizations();
        console.log("Optimizations applied successfully.");
    }

    // Confirma o carregamento do jogo antes de aplicar otimizações
    const intervalId = setInterval(() => {
        const gameLoaded = document.querySelector('canvas');
        if (gameLoaded) {
            clearInterval(intervalId);
            startOptimizations();
        }
    }, 1000); // Verifica a cada segundo

})();

QingJ © 2025

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