Mod Creation/Enabling DevTools for the Steam and Epic Clients: Difference between revisions
No edit summary |
|||
Line 9: | Line 9: | ||
# read all instructions before following them. | # read all instructions before following them. | ||
# verify the code is not malicious. | # verify the code is not malicious. | ||
=Notes from the SEMI Dev= | |||
Unless you know what you are doing, M3 is absolutely the recommended method of installing scripts. I (TheAlpacalypse) personally use M3 and can attest to it working perfectly with SEMI. If you are unclear what any of the below instructions say, simply follow the M3 installation instructions. | |||
=Automated Steam Installation with M3= | =Automated Steam Installation with M3= |
Revision as of 18:54, 15 November 2021
This page was last updated for (v1.0). |
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.
Notes from the SEMI Dev
Unless you know what you are doing, M3 is absolutely the recommended method of installing scripts. I (TheAlpacalypse) personally use M3 and can attest to it working perfectly with SEMI. If you are unclear what any of the below instructions say, simply follow the M3 installation instructions.
Automated Steam Installation with M3
Melvor Mod Manager (M3) is an open-source tool that allows for the easy installation and management of mods (scripts and extensions) for the Steam edition of Melvor Idle.
DISCLAIMER: It is very important to still use discretion when installing mods through M3 to ensure a mod does not execute malicious code! If you are unsure, ask in the Scripting and Extensions Discord channel.
- Download and install the latest version from here (Windows) or compile your own executable following these instructions (Windows, MacOS, Linux).
- Launch M3 and click Browse at the top and locate the installation directory for Melvor Idle.
- Not sure where it's installed? Go to Melvor Idle in your Steam library, right click, and go to
Manage
=>Browse local files
. - You can now install mods in three different ways:
- The Discover tab enables one-click installation of popular mods.
- From File: You can add mods from either a script (.js) file or extension manifest (manifest.json) file.
- From URL: Add scripts using their GreasyFork URL, e.g. https://greasyfork.org/en/scripts/434472-keybindings
- Click Launch and start using your mods!
Manually Installing Steam Console and Scripts
To use console commands, scripts, and extensions on Steam, follow the instructions in Setup and Loading Scripts. There is an alternate variation that may result in a cleaner Melvor Idle folder, but requires additional setup steps.
Setup
You only have to do this once.
- Download Melvor Idle on Steam, and find the installation folder. e.g.
[...]/steamapps/common/Melvor Idle
- Download the NW.js SDK (Windows: v0.54.0; other OS: v0.49.2). The version might change in the future, but you need the specific one listed.
- 64bit Windows: https://dl.nwjs.io/v0.54.0/nwjs-sdk-v0.54.0-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 userscripts from https://greasyfork.org/
- Download an extension's source from its repository. e.g.
- Extract all zipped files.
- Place the contents of the
nwjs-sdk*
folder in the Melvor Idle installation folder. - The current contents of the
nwjs-sdk-v0.54.0-win-x64
folder has 22 total items. Moving this to the Melvor Idle folder will overwrite over 100 existing files. - If it didn't ask you to overwrite any files then you did something wrong.
- Place the
icons
,styles
, and source directories (i.e.scripts
orsources
) of the extracted extensions in the Melvor Idle installation folder.
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 by pressing F12.
- You can also open the console by right clicking in the game and selecting
Inspect
. You may need to switch fromElement
toConsole
. - Set the context of the console to
game
. - The top left of the console has a dropdown: change it from
top
togame (steam.melvoridle.com)
. After doing this, you can use the console. - Load the scripts and extensions you placed in the installation folder 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) => { if (err) console.error(err); else eval(data); }); $(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/semi.css')}">`);
require('fs').readFile('sources/contentScript.js', 'utf8', (err, data) => { if (err) console.error(err); else eval(data); }); $(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/mainStyle.css')}">`);
require('fs').readFile('relativePathToMyReallyCoolScript.js', 'utf8', (err, data) => { if (err) console.error(err); else eval(data); });
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 folder
Extensions
in the Melvor Idle installation folder. - Make new directories for the extensions and scripts. e.g.
- Place the
icons
,styles
, and source (i.e.scripts
orsources
) directories of the extracted extensions in the Melvor Idle installation folder. - 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 andSEMI.js
for SEMI
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/
Combat Simulator: -icons/ -> Extensions/MICS-steam/icons/ -sources/ -> Extensions/MICS-steam/sources/ SEMI: -icons/ -> Extensions/SEMI-steam/icons/ -scripts/ -> Extensions/SEMI-steam/scripts/
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 by pressing F12.
- You can also open the console by right clicking in the game and selecting
Inspect
. You may need to switch fromElement
toConsole
. - Set the context of the console to
game
. - The top left of the console has a dropdown: change it from
top
togame (steam.melvoridle.com)
. After doing this, you can use the console. - Load the scripts and extensions you placed in the installation folder before.
[ // 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)}">`));
Auto-loading Scripts in Steam
- Follow the setup instructions.
- Create a
autorun.js
file in the Melvor Idle folder. - Edit
autorun.js
using a text editor: - 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
"inject_js_end": "autorun.js"
to the parameters ofpackage.json
, which should look like this:
setTimeout(function(){ /*insert all of the commands you would normally put in the console to load your scripts*/ }, 15000);
"node-remote":["*://*"], "inject_js_end": "autorun.js"}
FAQ
Common issues and solutions with installation.
Q: I can't get the console to work!
A: You must download the specific version in the instructions. Newer versions will not work or help.
- Make sure to move the contents of
nwjs-sdk*
, not the entire folder.
Q: The console won't open when I hit F12.
A: If you followed the proper nwjs installation instructions and the console still does not open when you press F12, you may have to change your Steam screenshot button. Alternatively, you can open the console by right-clicking the game and clicking Inspect
.
Q: I installed nwjs but nothing works.
A: When you move the contents of nwjs-sdk*
, you will be asked to overwrite over 100 files to your Melvor Idle folder. If you don't get this prompt, you didn't select the right files/folders.
Add Dev/Non-Main Branch Extensions to Chrome
Why do this?
Allows you to get the bleeding edge updates whilst the devs are working on a new patch. If you are a patron and want to use SEMI on the test builds, this is how.
This method is not recommended if you do not understand what a command line is.
Simple Installation
Disclaimer: This installation method will never automatically update. It now requires you to understand how to use a terminal, node, and npm. DO NOT MESSAGE THE DEV IF YOU CANNOT FIGURE THIS OUT. Wait for the extensions to release.
- Download and install Node.js if you do not already have it.
- Download and install npm if you do not already have it.
- Navigate to https://gitlab.com/aldousWatts/SEMI or whichever repo you want.
- On the left hand of the header, you should see a dropdown containing the word
main
. Click the dropdown, then selectdev
. - You should see a button in the header with a download icon. Click download, then .zip.
- After the download completes, put the folder wherever you like. Extract the zip.
- Open the folder in a terminal.
- Run the command
npm install && npm run build
. You might see several hundred errors. This is fine. - Run the command
node build.js
- Open the link
chrome://extensions/
, enable Developer Mode in the top right. - Click the button
Load unpacked
in the header. - Navigate to the
dist
folder. This should contain amanifest.json
. Afterwards, clickSelect Folder
. - After the extension loads, click update.
- If you have the Chrome extension from the web store, ensure that you remove it.
- Refresh the game.
Managing Dev/Non-Main Branch Extensions w/ git
This installation method will automatically fetch updates to dev/non-main branches.
- Open your terminal to the location you want the folder to go.
- Type the command
git clone [email protected]:aldousWatts/SEMI.git
into your terminal. - After it finishes cloning into the folder, cd into the folder then run
git fetch && git checkout <branchname>
. - Open the link
chrome://extensions/
, enable Developer Mode in the top right. - Click the button
Load unpacked
in the header. - Navigate to the top-level directory of the unpacked extension. For SEMI, this is the one that contains the manifest, README, etc. Afterwards, click
Select Folder
. - After the extension loads, click update.
- If you have the Chrome extension from the web store, ensure that you remove it.
- Refresh the game.
Melvor Idle version v1.3.1 (Released: 30th October 2024) |
---|
Error creating thumbnail: File missing Combat: Error creating thumbnail: File missing Attack • Error creating thumbnail: File missing Strength • Error creating thumbnail: File missing Defence • Error creating thumbnail: File missing Hitpoints • Error creating thumbnail: File missing Ranged • Error creating thumbnail: File missing Magic • Error creating thumbnail: File missing Prayer • Error creating thumbnail: File missing Slayer • Error creating thumbnail: File missing Corruption
|
Skills: Error creating thumbnail: File missing Farming • Error creating thumbnail: File missing Township • Error creating thumbnail: File missing Woodcutting • Error creating thumbnail: File missing Fishing • Error creating thumbnail: File missing Firemaking • Error creating thumbnail: File missing Cooking • Error creating thumbnail: File missing Mining • Error creating thumbnail: File missing Smithing • Error creating thumbnail: File missing Thieving • Error creating thumbnail: File missing Fletching • Error creating thumbnail: File missing Crafting • Error creating thumbnail: File missing Runecrafting • Error creating thumbnail: File missing Herblore • Error creating thumbnail: File missing Agility • Error creating thumbnail: File missing Summoning • Error creating thumbnail: File missing Astrology • Error creating thumbnail: File missing Alternative Magic • Error creating thumbnail: File missing Cartography • Error creating thumbnail: File missing Archaeology • Error creating thumbnail: File missing Harvesting
|
Other: Error creating thumbnail: File missing Beginners Guide • Guides • Error creating thumbnail: File missing Bank • Error creating thumbnail: File missing Combat • Error creating thumbnail: File missing Mastery • Error creating thumbnail: File missing Money Making • Error creating thumbnail: File missing Shop • Easter Eggs • Pets • Error creating thumbnail: File missing Golbin Raid • Error creating thumbnail: File missing Full Version • Throne of the Herald • Atlas of Discovery • Error creating thumbnail: File missing Into the Abyss
|
Reference Tables: Items, Equipment, Experience Table, Upgrading Items, Combat Areas, Slayer Areas, Dungeons, Strongholds, The Abyss, Monsters |