Yes. If you open the scriptcraft.jar, you'll see that there is a boot.js file in there. However, like adding code into any other plugin it's probably not a good idea to do injection like this. ScriptCraftJS already has the plugins folder for exactly this purpose. From the doc:
At server startup the ScriptCraft Java plugin is loaded and begins automatically
loading and executing all of the modules (javascript files with the extension .js)
it finds in the scriptcraft/plugins directory".
Any help?
I have several important variables in my ScripCraft plugin that I want the player to specificate. Is there a way to create a config file?
Yes. The easiest way is to use the built-in persist()
function like this...
var playerName = player.name;
var playerConfig = persist(playerName + '-myconfig', {} );
playerConfig.strengths = ['flight', 'magic' ];
playerConfig.weaknesses = ['arachnophobia' ];
The player config will automatically be saved to a .json
file in the scriptcraft/data/
directory.