All of the scripts require the current version of CoreScripts.
You can find a recommended way of setting up your server here ServerSetup.md.
To install any of my scripts:
- Go to the script's repository (DataManager as an example)
- Download the files. There are two ways to do so:
- Using git (recommended, get it here https://git-scm.com/downloads):
- Navigate to your
server/scripts/custom
folder - Open a powershell window in that folder (
shift + right click
on empty space) - Copy the https url from the script's repository (green button which says
Code
) - Type in
git clone
into your powershell window, paste the link (right click
) and pressEnter
- If you need to update the script in the future, simply open the powershell window again and run
git pull origin master
Keep in mind that there might be breaking changes to the configuration/data files
Make sure you can rollback in case you run into issues, rungit log
beforegit pull
and remember the lastcommit hash
, which looks something like53758ef
or53758efebceaaab340b8611d53ca5f9d4a8ed88c
To reset to an older version, rungit reset <commit-hash> --hard
- Navigate to your
- Download as a zip file:
- Open the code download menu on the script repository page (green button which says
Code
) - Click
Download ZIP
- Unpack the archive into a folder (e.g.
DataManager-master
) - Rename that folder to remove the branch name (e.g. from
DataManager-master
toDataManager
) - Copy this folder into your
server/scripts/custom
folder
- Open the code download menu on the script repository page (green button which says
- Using git (recommended, get it here https://git-scm.com/downloads):
- Add a line to your
server/scripts/customScripts.lua
:
For most scripts, simplyrequire
-ing itsmain.lua
is enough. For example:But if any other scripts depend on it (that's the case with many of my scripts), you also need to assign the result to a global variable:require('custom.VisualHarvesting.main')
Keep in mind that the order ofDataManager = require('custom.DataManager.main')
require
s incustomScripts.lua
is important, if a script depends on another, it should berequire
d after it - Most scripts also include a configuration file:
After the first time you launch the server with the script enabled, a json configuration file will be generated insideserver/data/custom/
You can edit this file manually to alter that script's behaviour - Some scripts might also generate data files in the same folder (
server/data/custom
):
Usually you are not supposed to change them manually (other than just delete them to reset the script's data), but if there is an exception, the script's page will mention it - All of my scripts expect you to close your server correctly:
On Linux, you can achieve that by sending\n
(pressingEnter
) in the server window
On Windows, you can use my ShutdownServer script