** EXAMPLE: Flush pending changes to disk and beep the console when no
one is on the server.
Server_vacant:
Active : true
Message_out : The server is now vacant.
Shell_cmd : none
Console_cmd : save-all
Sreact_cmd : none
Audio_alert : beep.3.500
** EXAMPLE: A complete server RESTART command for console and/or player
Commands:
0:
Cmd_name : RESTART
Default_params : none
Message_out : Restarting the server...
Shell_cmd : echo %time% > restart
Console_cmd : save-all, stop
Sreact_cmd : none
Player_cmd : none
Audio_alert : win.sound.exclamation
Override : true
Include_console : true
Op_allow : true
Perm_node : none
Player_allow : none
Active : true
1:
Cmd_name : STOP
Default_params : none
Message_out : Stopping the server...
Shell_cmd : del restart
Console_cmd : save-all, stop
Sreact_cmd : none
Player_cmd : none
Audio_alert : win.sound.exclamation
Override : true
Include_console : true
Op_allow : false
Perm_node : none
Player_allow : none
Active : true
RESTART
Creates a file named restart and proceeds to stop the server. The
batch file used to start the server looks for a file named restart after
exiting Java and, if found, branches to a label directly above the line
starting the server.
STOP
Is slightly modified to make sure restart is not present to allow final
completion of the batch file. IE:
SET BINDIR=%~dp0
CD /D "%BINDIR%"
:Restart
java -server -Xmx4G -Xms4G -jar craftbukkit.jar nogui
IF EXIST restart GOTO Restart
** EXAMPLE: /UNDO command using logblock.
Commands:
0:
Cmd_name : UNDO
Default_params : 1
Message_out : none
Shell_cmd : none
Console_cmd : none
Sreact_cmd : none
Player_cmd : lb rb player %player% time %parameters% minutes
Audio_alert : none
Override : true
Include_console : false
Op_allow : true
Perm_node : group.players
Player_allow : none
Active : true
/UNDO
Rolls back 1 minute, uses the Default_params setting
/UNDO 5
Rolls back 5 minutes, runtime parameter of 5 overrides Default_params
setting
** EXAMPLE: WorldEdit type command
Commands:
0:
Cmd_name : /SAVE
Default_params : none
Message_out : none
Shell_cmd : none
Console_cmd : none
Sreact_cmd : none
Player_cmd : /schematic save mcedit %parameters%
Audio_alert : none
Override : true
Include_console : false
Op_allow : true
Perm_node : group.artists
Player_allow : none
Active : true
//SAVE file_name
The first forward slash is always assumed in player commands.
Anything beyond that is part of the command definition. Adding
the "/" to the input command in effect will require two slashes as
a player, but one slash from the console since the console does
not assume a forward slash. Include_console is set to false here,
so console input is irrelevant.
** EXAMPLE: redefine a console command
Commands:
0:
Cmd_name : STOP
Default_params : none
Message_out : This server will not accept the stop command
Shell_cmd : none
Console_cmd : none
Sreact_cmd : none
Player_cmd : none
Audio_alert : win.sound.exclamation
Override : true
Include_console : true
Op_allow : false
Perm_node : none
Player_allow : none
Active : true
1:
Cmd_name : //STOP
Default_params : none
Message_out : none
Shell_cmd : none
Console_cmd : stop
Sreact_cmd : none
Player_cmd : none
Audio_alert : none
Override : true
Include_console : true
Op_allow : false
Perm_node : none
Player_allow : none
Active : true
STOP
When entered at the console will just beep the server and display the
message in Message_out
//STOP
Will stop the server, normally.
* note: I capitalized input commands and example usage only to emphasize
them. ShellReact is generally case insensitive. Variables, and YAML names
are the only case sensitive items processed by ShellReact. Strings
representing commands also have their case maintained because it is often
required.
Also, these examples contain all the settings for each command. This was
done because this is an example. Normally, unused settings may be omitted
for clarity.