General Description
- Ever wanted to test small pieces of codes but tired of compiling, copying and reloading? Ever wanted to check what's happening but don't know how? Ever wanted do something special as an op but lack a tool? The answer is Minescript: a plugin that allows you to run Ruby scripts in runtime! Access what ever you want and change it!
Installation
- If you want to try this plugin out,PLEASE READ THIS!.
Script
- Scripts are written in Ruby and run by JRuby.
- Scripts are [script name].minescript files in the ./plugins/minescript/ServerScript/ folder.
- Scripts can be run by command: /runscript [script name] [arg0] [arg1]...
- Scripts have:
- Full Ruby syntax support
- A reference to the running server: server
- A reference to the running player: player
- Args are passed with String[]: args
- Most important: Your Imagination
- Full Ruby syntax support
- Some example:
server.getOnlinePlayers.each{|p|p.setFireTicks(500)}java_importorg.bukkit.GameModeplayer.setGameMode(GameMode::CREATIVE)unlessplayer.nil?java.lang.System.out.println(args[0])unlessargs.nil?
ims: Interactive Minescript
- In version 0.4, the ims is added to the plugin. Ims works just like irb(Interactive Ruby), you can type your code line by line in runtime and see each line's outcome.
- Starts by using command: /ims
- After started, any chat you send will be viewed as code and sent to the ims instead to everyone else.
- You can still use any command so chat by command: /me.
- You have a reference to the running server: server
- You have a reference to the running player: player
Server Scripts Management
- In v0.6, the ability of manage server scripts in game is added. Simple command plus a Book and Quill will give you the power of creating, changing and deleting server scripts.
- To manage server scripts, use command /minescript [open|save|delete] [script name]
- Use /minescript open [script name]:
- Hold a Written Book or a Book and Quill(Recommand).
- Type the command.
- If the [script name] script exists, it's content will be load to the book you're holding.
- Hold a Written Book or a Book and Quill(Recommand).
- Use /minescript save [scrit name]:
- Hold a Written Book or a Book and Quill.
- Type the command.
- The book's contant will be saved to the [script name].minescript file(create a new one or overwrite the old one).
- Hold a Written Book or a Book and Quill.
- Use /minescrit delete [script name]:
- Hold whatever you want.
- Type the command.
- The file [script name].minescript will be deleted(NO REGRET!).
- Hold whatever you want.
- This is the only way I can think of which one can use the game itself to manage server scripts. However, using Book and Quill to modify a script is the worst way I have ever seen. Anyway, I think it's not so bad to have such a function. If you don't like it, forget about it.