Created
November 5, 2021 02:00
-
-
Save oorzkws/17f0a593fecb4bfea73299bd10187f6c to your computer and use it in GitHub Desktop.
userscript for lighter CPU/GPU usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Melvor NoAnims | |
// @namespace http://tampermonkey.net/ | |
// @version 0.01/0.22.1 | |
// @description Disables CPU/GPU/DOM intensive animations | |
// @author mootykins | |
// @match https://*.melvoridle.com/* | |
// @exclude https://wiki.melvoridle.com* | |
// @exclude https://*.melvoridle.com/index.php | |
// @noframes | |
// @grant none | |
// ==/UserScript== | |
// Loading code by GMiclotte | |
function noAnimScript() { | |
if (window.NoAnim !== undefined) { | |
console.error('NoAnim is already loaded!'); | |
} else { | |
loadNoAnim(); | |
} | |
function loadNoAnim(){ | |
window.NoAnim = {} | |
processItemNotify = function(itemID, qty){} | |
animateProgress = function(div, interval, stayFull = true){} | |
resetProgressAnimation = function(div){} | |
} | |
} | |
// inject the script | |
(function () { | |
function injectNoAnimScript(main) { | |
const noAnimScriptElement = document.createElement('script'); | |
noAnimScriptElement.textContent = `try {(${main})();} catch (e) {console.log(e);}`; | |
document.body.appendChild(noAnimScriptElement).parentNode.removeChild(noAnimScriptElement); | |
} | |
function loadNoAnimScript() { | |
if (confirmedLoaded !== undefined && confirmedLoaded) { | |
// Only load script after game has opened | |
clearInterval(noAnimScriptLoader); | |
injectNoAnimScript(noAnimScript); | |
} | |
} | |
const noAnimScriptLoader = setInterval(loadNoAnimScript, 200); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment