V10 scripting language
V10 scripting language
Overview/Description
The V10 scripting language is a serverside language which can be used to talk between the clients web browser and the minecraft server.
The language is very easy:
<?v10 command ?>
Which will get replaced in the parsed file with:
command = new Array("return1", "return2", "...");
which is, as some of you may have noticed, a JavaScript array! :) So a html page could look like this:
<html> <head> </head> <body> <script type="text/javascript"> <?v10 command ?> for(var i = 0; i < command.length; i++) document.write("Command " + i + ": " + command[i] + "<br>"); </script> </body> </html>
The result would look like this:
Command 0: return1 Command 2: return2 Command 3: ...
Commands
players
This command shows all players currently online.
maxPlayers
Returns an array with only one entry: The number maximum players on the minecraft server.
worlds
Returns all worlds.
plugins
Returns the plugin list.
bannedPlayers
Returns the names of all banned players.
chat
Returns the last minute of the chat. This list is not guaranteed to be sorted but it has timestamps! :)
gameMode
Returns the servers custom game mode.
ip
Returns the web clients IP.
ipBans
Returns a list of banned IPs.
serverName
Returns the server name.
serverHost
Returns the servers hostname or ip.
color
Returns the color (setable in the config).
login
This is a special command as it needs data via the HTTP GET or POST method.
In fact it needs the variables login and password to be set. login has to be the login name of the user (the user has to set a password for the httpd service first, see Commands/Password) and the password has to be the users password at login or the returned has on session continuing.
This command respects banned players if Command/Bans is set.
Returns a hash which has to be set as password in feature executions.
logout
This commands logs the use out. You have to send the username in the HTTP GET or POST variable login and the hash from the last login command in the password variable.
Returns nothing.
input
This needs input:
input(chat)
Reads new chatlines from the HTTP POST or GET variable chat sorted by lines.
If the user is logged in this automatically adds the username to the lines. Don't use this feature without login before!
Returns: "chat:1" where 1 is the number of lines sendet to minecraft.
input(reboot)
Reboots the server.
This needs the you to be a web admin.
Returns nothing.
input.shutdown
Stops the minecraft server.
This needs the you to be a web admin.
Returns nothing.
time(world)
Returns the time of the world "world".
API
Looking for an API to extend this? Have a look here.
Examples
You can see examples in the test.v10 file and at the integrated chat.
Comments