Mod Creation/Enabling DevTools for the Steam and Epic Clients: Difference between revisions
m (more formatting) |
m (final formatting) |
||
Line 13: | Line 13: | ||
How to use console commands, scripts, and extensions on Steam. | How to use console commands, scripts, and extensions on Steam. | ||
===Setup=== | ===1. Setup=== | ||
You only have to do this once. | You only have to do this once. | ||
<ol> | <ol> | ||
Line 38: | Line 38: | ||
</ol> | </ol> | ||
===Loading Scripts=== | ===2.a. Loading Scripts=== | ||
Loading scripts must be run every time the game is opened on Steam. | Loading scripts must be run every time the game is opened on Steam. | ||
<ol> | <ol> | ||
Line 60: | Line 60: | ||
</ol> | </ol> | ||
===Alternate Variation=== | ===2.b. Alternate Variation=== | ||
The following variant results in a cleaner directory without potential file name clashes. Note that the above does not clash for Combat Simulator + SEMI at the moment. | The following variant results in a cleaner directory without potential file name clashes. Note that the above does not clash for Combat Simulator + SEMI at the moment. | ||
====Additional Setup==== | |||
Do all the normal steps 1-5 of the Setup section then follow the below instructions. | |||
<ol> | |||
<li>Create a directory Extensions in the Melvor Idle installation directory.</li> | |||
<li>Make new directories for the extensions and scripts. e.g.</li> | |||
<pre> | |||
Extensions/ | Extensions/ | ||
Greasy Fork/ | Greasy Fork/ | ||
Line 80: | Line 84: | ||
scripts/ | scripts/ | ||
styles/ | styles/ | ||
</pre> | |||
<li>Place the icons, styles, and source (i.e. scripts or sources) directories of the extracted extensions in the respective created directories.</li> | |||
</ol> | |||
====Alternate Variation Loading Scripts==== | |||
If you followed the alternate variation setup steps, you will have to load scripts slightly differently. | |||
<ol> | |||
<li>Open the game and load a character.</li> | |||
<li>Open the dev tools console (F12).</li> | |||
<li>Set the context of the console to game.</li> | |||
<ul> | |||
<li>The top left of the console has a dropdown: change it from top to game (steam.melvoridle.com). After doing this, you can use the console.</li> | |||
</ul> | |||
<li>Load the scripts and extensions you placed in the installation directory before.</li> | |||
<pre> | |||
[ | [ | ||
// own | // own | ||
Line 102: | Line 119: | ||
//'Extensions/SEMI-steam/styles/semi.css', | //'Extensions/SEMI-steam/styles/semi.css', | ||
].forEach(cssFile => $(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL(cssFile)}">`)); | ].forEach(cssFile => $(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL(cssFile)}">`)); | ||
</pre> | |||
<li>If you are using extensions, edit the main extension script so all source files and icons can be found.</li> | |||
<ul> | |||
<li>e.g. edit the paths in contentScript.js for Combat Simulator and SEMI.js for SEMI</li> | |||
<pre> | |||
Combat Simulator: | |||
-icons/ -> Extensions/MICS-steam/icons/ | |||
-sources/ -> Extensions/MICS-steam/sources/ | |||
SEMI: | |||
-icons/ -> Extensions/SEMI-steam/icons/ | |||
-scripts/ -> Extensions/SEMI-steam/scripts/ | |||
</pre> | |||
</ol> | |||
==Auto-loading Scripts in Steam== | ==Auto-loading Scripts in Steam== |
Revision as of 23:09, 14 June 2021
This page was last updated for (v0.20). |
Disclaimer: It is highly recommended to BACKUP YOUR SAVE before running any scripts or extensions.
Disclaimer: Do not run code you can not understand or do not trust. Malicious code could be included in any script and extension.
Before You Begin
It's highly recommended before doing anything to
- back up your save by exporting or downloading the save file.
- read all instructions before following them.
- verify the code is not malicious.
Steam Console and Scripts
How to use console commands, scripts, and extensions on Steam.
1. Setup
You only have to do this once.
- Download Melvor Idle on Steam, and find the installation directory. e.g. [...]/steamapps/common/Melvor Idle
- Download the 0.49.2 version of NW.js SDK. The version might change in the future, but you need the specific one listed.
- 64bit Windows: https://dl.nwjs.io/v0.49.2/nwjs-sdk-v0.49.2-win-x64.zip
- 64bit Linux: https://dl.nwjs.io/v0.49.2/nwjs-sdk-v0.49.2-linux-x64.tar.gz
- Others: https://dl.nwjs.io/
- Download the scripts and extensions you want to use.
- Download from the script manager website. e.g. GreasyFork
- Download from the extension's browser store page.
- Download the source from the extension's repository. e.g.
- Extract all zipped files.
- Place the contents of the nwjs-sdk* directory in the Melvor Idle installation directory.
- Place the icons, styles, and source (i.e. scripts or sources) directories of the extracted extensions in the Melvor Idle installation directory.
2.a. Loading Scripts
Loading scripts must be run every time the game is opened on Steam.
- Open the game and load a character.
- Open the dev tools console (F12).
- Set the context of the console to game.
- The top left of the console has a dropdown: change it from top to game (steam.melvoridle.com). After doing this, you can use the console.
- Load the scripts and extensions you placed in the installation directory before.
- You can load SEMI like this:
- You can load the Combat Simulator like this:
- You can load user scripts like this, by changing the file name:
require('fs').readFile('scripts/SEMI.js', 'utf8', (err, data) => {eval(data);}) $(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/semi.css')}">`)
require('fs').readFile('sources/contentScript.js', 'utf8', (err, data) => {eval(data);}) $(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/mainStyle.css')}">`)
require('fs').readFile('relativePathToMyReallyCoolScript.js', 'utf8', (err, data) => {eval(data);})
2.b. Alternate Variation
The following variant results in a cleaner directory without potential file name clashes. Note that the above does not clash for Combat Simulator + SEMI at the moment.
Additional Setup
Do all the normal steps 1-5 of the Setup section then follow the below instructions.
- Create a directory Extensions in the Melvor Idle installation directory.
- Make new directories for the extensions and scripts. e.g.
- Place the icons, styles, and source (i.e. scripts or sources) directories of the extracted extensions in the respective created directories.
Extensions/ Greasy Fork/ Melvor Completion Log Helper.js Melvor Idle - Timestamped Saves.js Melvor-ETA/ time-remaining.js MICS-steam/ icons/ sources/ styles/ scripts/ nameOfMyReallyCoolScript.js SEMI-steam/ icons/ scripts/ styles/
Alternate Variation Loading Scripts
If you followed the alternate variation setup steps, you will have to load scripts slightly differently.
- Open the game and load a character.
- Open the dev tools console (F12).
- Set the context of the console to game.
- The top left of the console has a dropdown: change it from top to game (steam.melvoridle.com). After doing this, you can use the console.
- Load the scripts and extensions you placed in the installation directory before.
- If you are using extensions, edit the main extension script so all source files and icons can be found.
- e.g. edit the paths in contentScript.js for Combat Simulator and SEMI.js for SEMI
[ // own 'Extensions/scripts/nameOfMyReallyCoolScript.js', 'Extensions/Melvor-ETA/time-remaining.js', // extensions // other than the main script, extensions typically also require the insertion of a css file 'Extensions/MICS-steam/sources/contentScript.js', //'Extensions/SEMI-steam/scripts/SEMI.js', // Greasy Fork user scripts 'Extensions/Greasy Fork/Melvor Completion Log Helper.js', 'Extensions/Greasy Fork/Melvor Idle - Timestamped Saves.js', ].forEach(pts => require('fs').readFile(pts, 'utf8', (err, data) => {eval(data);})); // Extension css [ 'Extensions/MICS-steam/styles/mainStyle.css', //'Extensions/SEMI-steam/styles/semi.css', ].forEach(cssFile => $(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL(cssFile)}">`));
Combat Simulator: -icons/ -> Extensions/MICS-steam/icons/ -sources/ -> Extensions/MICS-steam/sources/ SEMI: -icons/ -> Extensions/SEMI-steam/icons/ -scripts/ -> Extensions/SEMI-steam/scripts/
Auto-loading Scripts in Steam
- Create a .js file in the Melvor Idle directory.
- Set the contents of the .js file
- The 15000 is just to give the game 15 seconds to get up and running, it doesn't seem to matter if it fires on the character screen or once you load a character.
- Add the following code to the parameters of package.json
setTimeout(function(){ /*insert all of the commands you would normally put in the console to load your scripts*/ }, 15000);
"inject_js_end": "pathToYourFile/yourFileName.js"
Melvor Idle version v1.2.2 (Released: 15th November 2023) | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Combat:
| |||||||||||||||||||
Skills:
| |||||||||||||||||||
Other:
| |||||||||||||||||||
Reference Tables: Items, Equipment, Experience Table, Upgrading Items, Combat Areas, Slayer Areas, Dungeons, Chest Loot Tables, Monsters, Monster Loot Tables |