Adding CraftScript to a Server

Installing CraftScript on your server and setting up an environment.

Introduction

CraftScript must be packaged inside a plugin.

The plugin is a domain: it decides what syntax is available, how and when scripts are to be loaded and run, what libraries are available to scripts, etc.

Requirements

In order to run a CraftScript environment the following is required:

Components of CraftScript

The Script Loader

The ScriptLoader is a simple interface that takes in a stream of data (e.g. a file contents or a string) and interprets this as an executable script object.

This object can then be run by itself or loaded into a script manager.

While domains are able to create their own loaders a basic SimpleScriptLoader is provided for most users.

A copy of this loader is available at ScriptLoader.BASIC.

The Script Manager

The script manager provides an environment of libraries, contexts, kinds and data for running a script.

A manager instance is a sort of universe of every resource available to a script while it is running.

The script manager is also responsible for dealing with any errors that occur while the script is running.

Last updated