您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to show all your modifiers
当前为
// ==UserScript== // @name Melvor Show Modifiers // @version 0.0.2 // @description Adds a button to show all your modifiers // @author GMiclotte // @match https://*.melvoridle.com/* // @exclude https://wiki.melvoridle.com/* // @grant none // @namespace http://tampermonkey.net/ // @noframes // ==/UserScript== function script() { window.melvorShowModifiers = {}; let codeString = showAllAgilityPassives.toString(); codeString = codeString.replace(/^function (\w+) *\(\)/, 'window.melvorShowModifiers.showAllModifiers = (modifiers, text) => '); codeString = codeString.replace(/agilityPassiveBonuses/g, 'modifiers'); codeString = codeString.replace('Current Global Active Passives from Agility', '${text}'); eval(codeString); window.melvorShowModifiers.showModifiers = (modifiers, text = 'Active Modifiers') => { const filteredModifiers = {}; Object.getOwnPropertyNames(modifiers).forEach(prop => { const value = modifiers[prop]; if (value.length === undefined) { if (value === 0) { return; } filteredModifiers[prop] = value; } else { if (value.length === 0) { return; } filteredModifiers[prop] = value; } }); window.melvorShowModifiers.showAllModifiers(filteredModifiers, text); } let modifierButton = () => { return '<div class="dropdown d-inline-block ml-2">' + '<button type="button" ' + 'class="btn btn-sm btn-dual text-combat-smoke" ' + 'id="page-header-modifiers" ' + 'onclick="window.melvorShowModifiers.showModifiers(playerModifiers);" ' + 'aria-haspopup="true" ' + 'aria-expanded="true">' + `<img class="skill-icon-xxs" src="${getItemMedia(CONSTANTS.item.Event_Clue_1)}">` + '</button>' + '</div>'; } let node = document.getElementById('page-header-potions-dropdown').parentNode; node.parentNode.insertBefore(html2Node(modifierButton()), node); } (function () { function injectScript(main) { const scriptElement = document.createElement('script'); scriptElement.textContent = `try {(${main})();} catch (e) {console.log(e);}`; document.body.appendChild(scriptElement).parentNode.removeChild(scriptElement); } function loadScript() { if ((window.isLoaded && !window.currentlyCatchingUp) || (typeof unsafeWindow !== 'undefined' && unsafeWindow.isLoaded && !unsafeWindow.currentlyCatchingUp)) { // Only load script after game has opened clearInterval(scriptLoader); injectScript(script); } } const scriptLoader = setInterval(loadScript, 200); })();