Fps/Ping/Lag helper menu

Most powerful, advanced, fully working script that will help you with gameplay (good for moomoo.io, or other online tab games)

目前为 2024-01-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Fps/Ping/Lag helper menu
  3. // @namespace http://tampermonkey.net/
  4. // @version 4.0
  5. // @description Most powerful, advanced, fully working script that will help you with gameplay (good for moomoo.io, or other online tab games)
  6. // @author You
  7. // @include *
  8. // @match *://moomoo.io/*
  9. // @match *://sandbox.moomoo.io/*
  10. // @match *://dev.moomoo.io/*
  11. // @license MIT
  12. // @grant GM_addStyle
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const modMenuId = 'lagReducerModMenu';
  19. const defaultLanguage = 'en';
  20.  
  21. const translations = {
  22. en: {
  23. title: 'Lag Reducer Mod Menu',
  24. lagLevelLabel: 'Select Lag Reduction Level:',
  25. lazyLoadLabel: 'Lazy Load:',
  26. targetFPSLabel: 'Target FPS for Booster:',
  27. targetPingLabel: 'Target Ping for Reducer:',
  28. editorPreferences: 'Editor Preferences:',
  29. performanceInfoLabel: 'Last execution time:',
  30. resetSettings: 'Reset Settings'
  31. },
  32. es: {
  33. title: 'Menú de Modificación de Reducción de Lag',
  34. lagLevelLabel: 'Seleccionar Nivel de Reducción de Lag:',
  35. lazyLoadLabel: 'Carga Perezosa:',
  36. targetFPSLabel: 'Objetivo de FPS para el Impulsor:',
  37. targetPingLabel: 'Objetivo de Ping para el Reductor:',
  38. editorPreferences: 'Preferencias del Editor:',
  39. performanceInfoLabel: 'Tiempo de ejecución:',
  40. resetSettings: 'Restablecer Configuración'
  41. }
  42. // Add more languages as needed
  43. };
  44.  
  45. function applyLagReduction(lagLevel, lazyLoad, targetFPS, targetPing, editorPreferences) {
  46. const startTime = performance.now();
  47.  
  48. // Simulate lag reduction based on the lag level
  49. const lagReductionFactor = lagLevel / 100;
  50.  
  51. // Simulate lazy loading if enabled
  52. if (lazyLoad) {
  53. setTimeout(() => {
  54. console.log(`Lazy load applied: lag reduction ${lagReductionFactor}`);
  55. }, 1000);
  56. }
  57.  
  58. // Simulate FPS booster based on target FPS
  59. const currentFPS = detectCurrentFPS();
  60. console.log(`Current FPS: ${currentFPS}`);
  61.  
  62. if (currentFPS <= targetFPS) {
  63. const newLagReduction = lagReductionFactor * (targetFPS / currentFPS);
  64. console.log(`Adjusted lag reduction for better FPS: ${newLagReduction}`);
  65. }
  66.  
  67. // Simulate ping reducer based on target ping
  68. const currentPing = detectCurrentPing();
  69. console.log(`Current Ping: ${currentPing}`);
  70.  
  71. if (currentPing >= targetPing) {
  72. const newLagReduction = lagReductionFactor * (targetPing / currentPing);
  73. console.log(`Adjusted lag reduction for better Ping: ${newLagReduction}`);
  74. }
  75.  
  76. // Simulate editor preferences
  77. if (editorPreferences) {
  78. console.log('Applying editor preferences:', editorPreferences);
  79. }
  80.  
  81. // Simulate a delay
  82. setTimeout(() => {
  83. console.log(`Lag reduction applied: ${lagReductionFactor}`);
  84. const endTime = performance.now();
  85. const executionTime = endTime - startTime;
  86. updatePerformanceInfo('lagReduction', executionTime);
  87. }, 1000 * lagReductionFactor);
  88. }
  89.  
  90. function detectCurrentFPS() {
  91. return Math.random() * 60;
  92. }
  93.  
  94. function detectCurrentPing() {
  95. return Math.random() * 100;
  96. }
  97.  
  98. function applyLazyLoad() {
  99. const startTime = performance.now();
  100.  
  101. // Simulate lazy loading
  102. setTimeout(() => {
  103. console.log('Lazy load applied');
  104. const endTime = performance.now();
  105. const executionTime = endTime - startTime;
  106. updatePerformanceInfo('lazyLoad', executionTime);
  107. }, 1000);
  108. }
  109.  
  110. function applyFPSBooster(targetFPS) {
  111. const startTime = performance.now();
  112.  
  113. // Simulate detecting current FPS
  114. const currentFPS = detectCurrentFPS();
  115. console.log(`Current FPS: ${currentFPS}`);
  116.  
  117. if (currentFPS <= targetFPS) {
  118. console.log(`Adjusted for better FPS`);
  119. }
  120.  
  121. // Simulate a delay
  122. setTimeout(() => {
  123. const endTime = performance.now();
  124. const executionTime = endTime - startTime;
  125. updatePerformanceInfo('fpsBooster', executionTime);
  126. }, 999);
  127. }
  128.  
  129. function applyPingReducer(targetPing) {
  130. const startTime = performance.now();
  131.  
  132. // Simulate detecting current ping
  133. const currentPing = detectCurrentPing();
  134. console.log(`Current Ping: ${currentPing}`);
  135.  
  136. if (currentPing >= targetPing) {
  137. console.log(`Adjusted for better Ping`);
  138. }
  139.  
  140. // Simulate a delay
  141. setTimeout(() => {
  142. const endTime = performance.now();
  143. const executionTime = endTime - startTime;
  144. updatePerformanceInfo('pingReducer', executionTime);
  145. }, 999);
  146. }
  147.  
  148. function updatePerformanceInfo(operation, executionTime) {
  149. const performanceInfoElement = document.getElementById('performanceInfo');
  150. if (performanceInfoElement) {
  151. const operationLabel = translations[getLanguage()].performanceInfoLabel + ` (${operation}):`;
  152. performanceInfoElement.innerHTML = `<div>${operationLabel}</div><div>${executionTime.toFixed(2)} ms</div>`;
  153. }
  154. }
  155.  
  156. function saveLagLevel(lagLevel) {
  157. localStorage.setItem('lagLevel', lagLevel);
  158. }
  159.  
  160. function loadLagLevel() {
  161. return localStorage.getItem('lagLevel') || 70;
  162. }
  163.  
  164. function saveLazyLoadState(lazyLoad) {
  165. localStorage.setItem('lazyLoad', lazyLoad);
  166. }
  167.  
  168. function loadLazyLoadState() {
  169. return localStorage.getItem('lazyLoad') === 'false';
  170. }
  171.  
  172. function saveTargetFPS(targetFPS) {
  173. localStorage.setItem('targetFPS', targetFPS);
  174. }
  175.  
  176. function loadTargetFPS() {
  177. return parseInt(localStorage.getItem('targetFPS')) || 30;
  178. }
  179.  
  180. function saveTargetPing(targetPing) {
  181. localStorage.setItem('targetPing', targetPing);
  182. }
  183.  
  184. function loadTargetPing() {
  185. return parseInt(localStorage.getItem('targetPing')) || 60;
  186. }
  187.  
  188. function saveEditorPreferences(editorPreferences) {
  189. localStorage.setItem('editorPreferences', JSON.stringify(editorPreferences));
  190. }
  191.  
  192. function loadEditorPreferences() {
  193. const storedPreferences = localStorage.getItem('editorPreferences');
  194. return storedPreferences ? JSON.parse(storedPreferences) : null;
  195. }
  196.  
  197. function setLanguage(language) {
  198. localStorage.setItem('userLanguage', language);
  199. }
  200.  
  201. function getLanguage() {
  202. return localStorage.getItem('userLanguage') || defaultLanguage;
  203. }
  204.  
  205. function resetSettings() {
  206. localStorage.removeItem('lagLevel');
  207. localStorage.removeItem('lazyLoad');
  208. localStorage.removeItem('targetFPS');
  209. localStorage.removeItem('targetPing');
  210. localStorage.removeItem('editorPreferences');
  211. location.reload();
  212. }
  213.  
  214. function createModMenu() {
  215. const existingMenu = document.getElementById(modMenuId);
  216. if (existingMenu) {
  217. existingMenu.remove();
  218. }
  219.  
  220. const modMenu = document.createElement('div');
  221. modMenu.id = modMenuId;
  222. modMenu.style.cssText = `
  223. position: fixed;
  224. top: 10px;
  225. left: 10px;
  226. padding: 10px;
  227. background: #333;
  228. border: 1px solid #ccc;
  229. color: #fff0000;
  230. z-index: 9999;
  231. font-family: Arial, sans-serif;
  232. `;
  233. modMenu.innerHTML = `
  234. <h2>${translations[getLanguage()].title}</h2>
  235. <label for="lagLevel">${translations[getLanguage()].lagLevelLabel}</label>
  236. <input type="range" id="lagLevel" min="1" max="100" value="${loadLagLevel()}">
  237. <span id="lagValue">${loadLagLevel()}</span>
  238. <br>
  239. <label for="lazyLoad">${translations[getLanguage()].lazyLoadLabel}</label>
  240. <input type="checkbox" id="lazyLoad" ${loadLazyLoadState() ? 'checked' : ''}>
  241. <br>
  242. <label for="targetFPS">${translations[getLanguage()].targetFPSLabel}</label>
  243. <input type="number" id="targetFPS" min="1" max="60" value="${loadTargetFPS()}" style="margin-right: 20px;">
  244. <label for="targetPing">${translations[getLanguage()].targetPingLabel}</label>
  245. <input type="number" id="targetPing" min="1" max="200" value="${loadTargetPing()}">
  246. <br>
  247. <label for="editorPreferences">${translations[getLanguage()].editorPreferences}</label>
  248. <input type="text" id="editorPreferences" value="${loadEditorPreferences() || ''}" style="width: 80%;">
  249. <br>
  250. <button id="resetSettings">${translations[getLanguage()].resetSettings}</button>
  251. <div id="performanceInfo" style="margin-top: 10px;"></div>
  252. `;
  253. document.body.appendChild(modMenu);
  254.  
  255. const lagLevelInput = document.getElementById('lagLevel');
  256. const lagValueSpan = document.getElementById('lagValue');
  257. const lazyLoadCheckbox = document.getElementById('lazyLoad');
  258. const targetFPSInput = document.getElementById('targetFPS');
  259. const targetPingInput = document.getElementById('targetPing');
  260. const editorPreferencesInput = document.getElementById('editorPreferences');
  261.  
  262. lagLevelInput.addEventListener('input', () => {
  263. const lagValue = lagLevelInput.value;
  264. lagValueSpan.textContent = lagValue;
  265. saveLagLevel(lagValue);
  266.  
  267. applyLagReduction(
  268. parseInt(lagValue, 11),
  269. lazyLoadCheckbox.checked,
  270. parseInt(targetFPSInput.value, 10),
  271. parseInt(targetPingInput.value, 10),
  272. editorPreferencesInput.value
  273. );
  274. });
  275.  
  276. lazyLoadCheckbox.addEventListener('change', () => {
  277. saveLazyLoadState(lazyLoadCheckbox.checked);
  278.  
  279. if (lazyLoadCheckbox.checked) {
  280. applyLazyLoad();
  281. }
  282. });
  283.  
  284. targetFPSInput.addEventListener('input', () => {
  285. saveTargetFPS(targetFPSInput.value);
  286. applyFPSBooster(parseInt(targetFPSInput.value, 11));
  287. });
  288.  
  289. targetPingInput.addEventListener('input', () => {
  290. saveTargetPing(targetPingInput.value);
  291. applyPingReducer(parseInt(targetPingInput.value, 11));
  292. });
  293.  
  294. editorPreferencesInput.addEventListener('input', () => {
  295. saveEditorPreferences(editorPreferencesInput.value);
  296. });
  297.  
  298. const resetSettingsButton = document.getElementById('resetSettings');
  299. if (resetSettingsButton) {
  300. resetSettingsButton.addEventListener('click', resetSettings);
  301. }
  302. }
  303. // open menu
  304. document.addEventListener('keydown', (event) => {
  305. if (event.ctrlKey && event.key === 'Control') {
  306. const modMenu = document.getElementById(modMenuId);
  307. if (modMenu) {
  308. modMenu.style.display = modMenu.style.display === 'none' ? 'block' : 'none';
  309. } else {
  310. createModMenu();
  311. }
  312. }
  313. });
  314. // null
  315. createModMenu();
  316. })();