djkrose / 7DTD-ScriptingMod

Adds scripting support and other useful functionality to 7 Days To Die dedicated server
19 stars 10 forks source link

djkrose's Scripting Mod

Adds scripting support and other useful functionality to 7 Days To Die dedicated server.

Download

Scripting Examples

Lua JavaScript
1. Create file example.lua ```lua -- @commands mylua -- @description My first Lua command -- @help This example shows how easy it is -- to add a new command in Lua script print "Hello Lua World!" ``` 2\. Drop file into *\\Mods\\ScriptingMod\\scripts* folder
3\. Execute commands: `help mylua` and `mylua`
![Example mylua](https://raw.githubusercontent.com/wiki/djkrose/7DTD-ScriptingMod/images/example-myjs.png)
4\. Profit!
1. Create file example.js ```javascript // @commands myjavascript myjs // @description My first JavaScript command // @help This example shows how easy it is // to add a new command in JavaScript console.log("Hello JavaScript World!"); ``` 2\. Drop file into *\\Mods\\ScriptingMod\\scripts* folder
3\. Execute commands: `help myjs`and `myjs`
![Example mylua](https://raw.githubusercontent.com/wiki/djkrose/7DTD-ScriptingMod/images/example-myjs.png)
4\. Profit!

Why Scripting?

Built-in Commands

dj-versionShows djkrose's Scripting Mod version information.
dj-exportExports a prefab including all container content, sign texts, ownership, etc.
dj-importImports a prefab, optionally including all container content, sign texts, ownership, etc.
dj-log-eventsEnables or disables logging of events to the server console.
dj-regenRegenerates a chunk or custom area based on the world seed.
dj-repairRepairs server problems of various kinds.
dj-patchEnables or disables runtime server patches like the dupe exploit fix.
dj-posShows the current player's position in various units and formats.
dj-eac-whitelistAllows players to be exempt from EAC checks on an EAC-enabled server

Compatibility

Documentation

To get you started, the mod contains a couple of example scripts that you can inspect. They can be activated by removing the trailing underscore (_) from the file name.

Detailed documentation and API specification is just starting to grow: Documentation Wiki

Source Code

Since version 1.0 the source code is fully available and the releases are not obfuscated anymore. Feel free to look around and copy what you like, but please leave the author and link to this GitHub intact (see license).

Of course you are free to fork and continue with changes on your own, but you are also invited to contibute directly to the main release by submtting feature requests, bug reports, and pull requests.

Tipps for using the source code:

Road Map

I want to add a lot more to it as time permits it. Here are some ideas:

See issues section for some individual features.

This is just a rough outline; everything is subject to change depending on your feedback, on feasibility, on my real life commitments, and simply on my pleasure to continue in any direction or at all.

Contact

Feedback is welcome! Please report specific suggestions and bugs here:

For questions and support you can use:

Just remember: This software is provided free of charge, as is, without any guarantee or support. You are not entitled to support, nor is anyone but you liable for data loss. If it doesn't work, that is just bad luck. If data is lost, you should've made a backup.

License

Creative Commons License djkrose's Scripting Mod is licensed under a CC BY-NC 4.0. That means, you are free to use the mod and the source code (once published) for non-commercial purposes; just leave the credit notes intact.

This mod is a private project and not affiliated with the official 7DTD game or with The Fun Pimps in any way.