Buscript adds the capability for a server to run Javascript from text files. Beyond what is normally offered by Javascript, buscript adds some global functions to enable scripts to be written easily and hopefully by anyone!
The latest development builds can always be found at http://ci.onarandombox.com/job/Buscript/
Currently there's just one command
/run <script> [player]
Scripts are text files that contain Javascript code. This may sound scary to people unfamiliar with coding but luckily buscript provides several easy to use methods for creating basic scripts.
Your script files must be located in the scripts directory that the Buscript plugin creates for you automatically. The file extension used can be anything (even nothing) as long as the file contains valid Javascript.
broadcast("Hey everyone, §c%target% §fis a cool guy!") command("op %target%")
message("%target%", "You have just been given flight in the creative world for 30 minutes!") addPerm("creative", "%target%", "flight.permission") runLater("remove-perm.txt", "30m", "%target%")
message("%target%", "Your flight power has been removed, hope you weren't up there!") removePerm("creative", "%target%", "flight.permission")
Source code: https://github.com/dumptruckman/Buscript
Javadoc: http://ci.onarandombox.com/view/Other%20Great%20Plugins/job/Buscript/javadoc/
Maven repository: http://repo.onarandombox.com/content/groups/public/
Maven pom information:
<groupId>com.dumptruckman.minecraft</groupId> <artifactId>buscript</artifactId> <version>1.0-SNAPSHOT</version>
You can easily use this as a library instead of a plugin by adding it as a library to your plugin. I would recommend shading it in with maven, possibly relocating the code to a new namespace.
After that, simple create a
new Buscript(yourPlugin)
and from there you will find all the methods you need to run your own scripts and even add your own global methods!
If you wish to extend the functionality of Buscript as a plugin, the main plugin class BuscriptPlugin has a convenient getAPI() method to return the Buscript object it has on hand.
The javadocs are available for download via the maven repository.