Slither.io Lag Reducer

Reduce lag on Slither.io by adjusting settings

  1. // ==UserScript==
  2. // @name Slither.io Lag Reducer
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Reduce lag on Slither.io by adjusting settings
  6. // @author You
  7. // @match http://slither.io
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to set game settings to reduce lag
  15. function reduceLag() {
  16. // Change game settings here to improve performance
  17. // Example: Reduce rendering quality
  18. window.gameSettings = {
  19. ...window.gameSettings,
  20. renderQuality: 'low'
  21. };
  22. console.log('Lag reduction settings applied');
  23. }
  24.  
  25. // Apply lag reduction settings when the page is loaded
  26. window.addEventListener('load', reduceLag);
  27. // ==UserScript==
  28. // @name Slither.io Lag Reducer with FPS Display
  29. // @namespace http://tampermonkey.net/
  30. // @version 0.2
  31. // @description Reduce lag and display FPS on Slither.io
  32. // @author You
  33. // @match *://slither.io/*
  34. // @grant none
  35. // ==/UserScript==
  36.  
  37. (function() {
  38. 'use strict';
  39.  
  40. // Create a GUI element to display FPS
  41. const fpsDisplay = document.createElement('div');
  42. fpsDisplay.style.position = 'fixed';
  43. fpsDisplay.style.top = '10px';
  44. fpsDisplay.style.right = '10px';
  45. fpsDisplay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  46. fpsDisplay.style.color = 'white';
  47. fpsDisplay.style.padding = '5px';
  48. fpsDisplay.style.borderRadius = '5px';
  49. fpsDisplay.style.fontSize = '14px';
  50. fpsDisplay.style.zIndex = '1000';
  51. document.body.appendChild(fpsDisplay);
  52.  
  53. // Function to set game settings to reduce lag
  54. function reduceLag() {
  55. window.gameSettings = {
  56. ...window.gameSettings,
  57. renderQuality: 'low'
  58. };
  59. console.log('Lag reduction settings applied');
  60. }
  61.  
  62. // Function to calculate and display FPS
  63. function updateFPS() {
  64. let lastTime = performance.now();
  65. let frameCount = 0;
  66.  
  67. function calculateFPS() {
  68. const now = performance.now();
  69. frameCount++;
  70. if (now - lastTime >= 1000) {
  71. const fps = frameCount / ((now - lastTime) / 1000);
  72. fpsDisplay.textContent = `FPS: ${Math.round(fps)}`;
  73. frameCount = 0;
  74. lastTime = now;
  75. }
  76. requestAnimationFrame(calculateFPS);
  77. }
  78.  
  79. requestAnimationFrame(calculateFPS);
  80. }
  81.  
  82. // Apply lag reduction and start FPS display when the page is loaded
  83. window.addEventListener('load', () => {
  84. reduceLag();
  85. updateFPS();
  86. });
  87. })();
  88.  
  89. })();