Mod Creation/Enabling DevTools for the Steam and Epic Clients: Difference between revisions

m
formatting
(page creation)
 
m (formatting)
Line 3: Line 3:


'''Disclaimer:''' Do not run code you can not understand or do not trust. Malicious code could be included in any script and extension.
'''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=
=Steam Console and Scripts=
How to use console commands, scripts, and extensions on Steam.
How to use console commands, scripts, and extensions on Steam.
Disclaimer: the following instructions worked on my linux and windows machines. I do not guarantee that this will work for you.
Disclaimer 2: don't run scripts you don't trust, but if you do that's your problem :woman_shrugging:
You should probably first
- take a local backup of your save (you should do this whenever you try a new script tbh), and
- read all the instructions in (A) and (B) (and maybe (C)) before you start following them.
(A) Setup - You only have to do this once.
(1) download Melvor Idle on Steam, and find the installation directory [...]/steamapps/common/Melvor Idle
(2) download the appropriate NW.js SDK, the current version you want is 0.49.2 the version might change in the future
- 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: pick the appropriate version on https://dl.nwjs.io/
(3) download the extensions you want to use
- through the chrome extension store, or
- download the source from the extension's repository, e.g.
- - combat sim: https://github.com/visua0/Melvor-Idle-Combat-Simulator-Reloaded/releases
- - SEMI: https://gitlab.com/aldousWatts/SEMI/-/archive/main/SEMI-main.zip
(4) extract all these zipped files
- place the contents of the nwjs-sdk* directory in the Melvor Idle installation directory
- place the icons, styles and source (e.g. scripts or sources) directories of the extracted extensions in the Melvor Idle installation directory
- - you might have to dig around a bit to locate these directories, for example for the Combat Simulator these directories are contained in another directory called Extension
(5) download any user scripts you want to use and also place them in the Melvor Idle installation directory
(6) open the game and load a character
(7) open the dev tools console (F12)
(8) set the context of the console
- 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
(9) load the scripts and extensions you placed in the installation directory before.
You can load SEMI like this:
require('fs').readFile('scripts/SEMI.js', 'utf8', (err, data) => {eval(data);})
$(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/semi.css')}">`)


You can load the Combat Simulator like this:
==Setup==
require('fs').readFile('sources/contentScript.js', 'utf8', (err, data) => {eval(data);})
You only have to do this once.
$(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/mainStyle.css')}">`)
# Download Melvor Idle on Steam, and find the installation directory [...]/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.
#** Combat Sim: https://github.com/visua0/Melvor-Idle-Combat-Simulator-Reloaded/releases
#** SEMI: https://gitlab.com/aldousWatts/SEMI/-/archive/main/SEMI-main.zip
# 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.
# 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:
require('fs').readFile('scripts/SEMI.js', 'utf8', (err, data) => {eval(data);})
$(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/semi.css')}">`)
::*You can load the Combat Simulator like this:
require('fs').readFile('sources/contentScript.js', 'utf8', (err, data) => {eval(data);})
$(document.head).append(`<link rel="stylesheet" href="${chrome.runtime.getURL('styles/mainStyle.css')}">`)
::*You can load user scripts like this, by changing the file name:
require('fs').readFile('relativePathToMyReallyCoolScript.js', 'utf8', (err, data) => {eval(data);})


You can load user scripts like this, by changing the file name:
==Alternate Variation==
require('fs').readFile('relativePathToMyReallyCoolScript.js', 'utf8', (err, data) => {eval(data);})
(C) Cleaner variation - You don't have to do the following at all, it is a slight variant to the previous instructions, which takes some more fiddling but results in a cleaner directory without potential file name clashes. Note that the above does not clash for Combat Simulator + SEMI at the moment.
(C) Cleaner variation - You don't have to do the following at all, it is a slight variant to the previous instructions, which takes some more fiddling but results in a cleaner directory without potential file name clashes. Note that the above does not clash for Combat Simulator + SEMI at the moment.


454

edits