Reduces lag and improves FPS on Roblox by optimizing graphics settings, memory usage, and performance
Size
11.5 KB
Version
1.0.1
Created
Jan 23, 2026
Updated
12 days ago
1// ==UserScript==
2// @name Roblox Performance Booster for Chromebook
3// @description Reduces lag and improves FPS on Roblox by optimizing graphics settings, memory usage, and performance
4// @version 1.0.1
5// @match https://www.roblox.com/*
6// @match https://web.roblox.com/*
7// ==/UserScript==
8(function() {
9 'use strict';
10
11 console.log('Roblox Performance Booster: Initializing...');
12
13 // Performance optimization settings
14 const performanceSettings = {
15 reduceGraphics: true,
16 optimizeMemory: true,
17 boostFPS: true,
18 disableParticles: true,
19 reduceShadows: true,
20 lowerTextureQuality: true
21 };
22
23 // Debounce function to prevent excessive calls
24 function debounce(func, wait) {
25 let timeout;
26 return function executedFunction(...args) {
27 const later = () => {
28 clearTimeout(timeout);
29 func(...args);
30 };
31 clearTimeout(timeout);
32 timeout = setTimeout(later, wait);
33 };
34 }
35
36 // Apply performance optimizations to Roblox game
37 function applyPerformanceOptimizations() {
38 console.log('Roblox Performance Booster: Applying optimizations...');
39
40 try {
41 // Optimize WebGL settings for better performance
42 const canvas = document.querySelector('canvas');
43 if (canvas) {
44 console.log('Roblox Performance Booster: Canvas found, optimizing WebGL...');
45
46 // Get WebGL context and optimize
47 const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
48 if (gl) {
49 // Disable antialiasing for better performance
50 gl.disable(gl.BLEND);
51 gl.disable(gl.DEPTH_TEST);
52 console.log('Roblox Performance Booster: WebGL optimizations applied');
53 }
54
55 // Reduce canvas resolution for better FPS
56 if (performanceSettings.boostFPS) {
57 const scale = 0.75; // 75% resolution
58 canvas.style.imageRendering = 'pixelated';
59 console.log('Roblox Performance Booster: Canvas resolution optimized');
60 }
61 }
62
63 // Inject CSS to hide unnecessary visual elements
64 if (performanceSettings.reduceGraphics) {
65 TM_addStyle(`
66 /* Reduce visual effects */
67 * {
68 text-shadow: none !important;
69 box-shadow: none !important;
70 }
71
72 /* Optimize animations */
73 * {
74 animation-duration: 0.1s !important;
75 transition-duration: 0.1s !important;
76 }
77
78 /* Hide non-essential elements */
79 .rbx-particles,
80 .particle-effect,
81 [class*="particle"],
82 [class*="effect"] {
83 display: none !important;
84 }
85 `);
86 console.log('Roblox Performance Booster: Visual optimizations applied');
87 }
88
89 // Memory optimization - clear caches periodically
90 if (performanceSettings.optimizeMemory) {
91 setInterval(() => {
92 // Force garbage collection by clearing unused objects
93 if (window.gc) {
94 window.gc();
95 }
96 console.log('Roblox Performance Booster: Memory optimization cycle completed');
97 }, 60000); // Every 60 seconds
98 }
99
100 // Optimize Roblox settings via localStorage
101 optimizeRobloxSettings();
102
103 } catch (error) {
104 console.error('Roblox Performance Booster: Error applying optimizations:', error);
105 }
106 }
107
108 // Optimize Roblox settings stored in localStorage
109 function optimizeRobloxSettings() {
110 try {
111 // Set graphics quality to lowest for best performance
112 const graphicsSettings = {
113 'SavedQualityLevel': '1', // Lowest quality
114 'GraphicsQualityLevel': '1',
115 'MasterVolume': '0.5',
116 'RenderShadows': 'false',
117 'RenderParticles': 'false'
118 };
119
120 for (const [key, value] of Object.entries(graphicsSettings)) {
121 localStorage.setItem(key, value);
122 }
123
124 console.log('Roblox Performance Booster: Roblox settings optimized');
125 } catch (error) {
126 console.error('Roblox Performance Booster: Error optimizing settings:', error);
127 }
128 }
129
130 // Create performance control panel
131 function createControlPanel() {
132 const panel = document.createElement('div');
133 panel.id = 'roblox-perf-panel';
134 panel.innerHTML = `
135 <div style="position: fixed; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.9); color: white; padding: 15px; border-radius: 10px; z-index: 999999; font-family: Arial, sans-serif; min-width: 250px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);">
136 <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
137 <h3 style="margin: 0; font-size: 14px; color: #00ff00;">⚡ Performance Booster</h3>
138 <button id="perf-toggle-btn" style="background: #ff4444; border: none; color: white; padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 12px;">Hide</button>
139 </div>
140 <div id="perf-content">
141 <div style="margin-bottom: 10px;">
142 <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
143 <input type="checkbox" id="reduce-graphics" checked style="margin-right: 8px;">
144 <span>Reduce Graphics</span>
145 </label>
146 </div>
147 <div style="margin-bottom: 10px;">
148 <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
149 <input type="checkbox" id="optimize-memory" checked style="margin-right: 8px;">
150 <span>Optimize Memory</span>
151 </label>
152 </div>
153 <div style="margin-bottom: 10px;">
154 <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
155 <input type="checkbox" id="boost-fps" checked style="margin-right: 8px;">
156 <span>Boost FPS</span>
157 </label>
158 </div>
159 <div style="margin-bottom: 10px;">
160 <label style="display: flex; align-items: center; cursor: pointer; font-size: 12px;">
161 <input type="checkbox" id="disable-particles" checked style="margin-right: 8px;">
162 <span>Disable Particles</span>
163 </label>
164 </div>
165 <button id="apply-settings-btn" style="width: 100%; background: #00ff00; border: none; color: black; padding: 8px; border-radius: 5px; cursor: pointer; font-weight: bold; font-size: 12px; margin-top: 10px;">Apply Settings</button>
166 <div id="fps-counter" style="margin-top: 10px; padding: 8px; background: rgba(0, 255, 0, 0.1); border-radius: 5px; text-align: center; font-size: 12px;">
167 FPS: <span id="fps-value">--</span>
168 </div>
169 </div>
170 </div>
171 `;
172
173 document.body.appendChild(panel);
174
175 // Toggle panel visibility
176 const toggleBtn = document.getElementById('perf-toggle-btn');
177 const content = document.getElementById('perf-content');
178 let isVisible = true;
179
180 toggleBtn.addEventListener('click', () => {
181 isVisible = !isVisible;
182 content.style.display = isVisible ? 'block' : 'none';
183 toggleBtn.textContent = isVisible ? 'Hide' : 'Show';
184 });
185
186 // Apply settings button
187 document.getElementById('apply-settings-btn').addEventListener('click', () => {
188 performanceSettings.reduceGraphics = document.getElementById('reduce-graphics').checked;
189 performanceSettings.optimizeMemory = document.getElementById('optimize-memory').checked;
190 performanceSettings.boostFPS = document.getElementById('boost-fps').checked;
191 performanceSettings.disableParticles = document.getElementById('disable-particles').checked;
192
193 applyPerformanceOptimizations();
194
195 // Show confirmation
196 const btn = document.getElementById('apply-settings-btn');
197 btn.textContent = '✓ Applied!';
198 btn.style.background = '#00aa00';
199 setTimeout(() => {
200 btn.textContent = 'Apply Settings';
201 btn.style.background = '#00ff00';
202 }, 2000);
203 });
204
205 // FPS Counter
206 let lastTime = performance.now();
207 let frames = 0;
208
209 function updateFPS() {
210 frames++;
211 const currentTime = performance.now();
212
213 if (currentTime >= lastTime + 1000) {
214 const fps = Math.round((frames * 1000) / (currentTime - lastTime));
215 document.getElementById('fps-value').textContent = fps;
216 frames = 0;
217 lastTime = currentTime;
218 }
219
220 requestAnimationFrame(updateFPS);
221 }
222
223 updateFPS();
224
225 console.log('Roblox Performance Booster: Control panel created');
226 }
227
228 // Wait for page to load and Roblox game to initialize
229 function waitForRobloxGame() {
230 const checkInterval = setInterval(() => {
231 const canvas = document.querySelector('canvas');
232 if (canvas) {
233 console.log('Roblox Performance Booster: Roblox game detected');
234 clearInterval(checkInterval);
235 applyPerformanceOptimizations();
236 }
237 }, 1000);
238
239 // Stop checking after 30 seconds
240 setTimeout(() => {
241 clearInterval(checkInterval);
242 }, 30000);
243 }
244
245 // Initialize the extension
246 function init() {
247 console.log('Roblox Performance Booster: Starting initialization...');
248
249 // Create control panel immediately
250 if (document.body) {
251 createControlPanel();
252 } else {
253 TM_runBody(() => {
254 createControlPanel();
255 });
256 }
257
258 // Apply initial optimizations
259 applyPerformanceOptimizations();
260
261 // Wait for Roblox game to load
262 waitForRobloxGame();
263
264 // Monitor for new canvas elements (game restarts)
265 const observer = new MutationObserver(debounce(() => {
266 const canvas = document.querySelector('canvas');
267 if (canvas && !canvas.dataset.optimized) {
268 canvas.dataset.optimized = 'true';
269 applyPerformanceOptimizations();
270 }
271 }, 1000));
272
273 observer.observe(document.body, {
274 childList: true,
275 subtree: true
276 });
277
278 console.log('Roblox Performance Booster: Initialization complete!');
279 }
280
281 // Start the extension
282 if (document.readyState === 'loading') {
283 document.addEventListener('DOMContentLoaded', init);
284 } else {
285 init();
286 }
287
288})();