02-21-2012
Help with script that reads and writes java console Minecraft
Hi
I am looking for an easy way to lock game mode (0) for everyone included op on a Minecraft server. It can be a script that every time a player changes game to 1 the script changes back to 0. What the player writes is visible in the java console. I am not good at script programming and my guess is that this is easy for someone who is good script programming. The OS is OSX. I appreciate all help on this.
gamemode <playername> <0|1> Changes the game mode for playername to Survival (0) mode or Creative (1) mode.
Example player player1 writes to set gamemode 1:
gamemode player1 1
Example player player1 writes to set gamemode 0:
gamemode player1 0
I want gamemode to be set to 0 always so I am looking for something like:
Example player player1 writes to set gamemode 1:
gamemode player1 1
On the CONSOLE
2012-02-20 19:59:26 [INFO] player1 issued server command: gamemode player1 1
The script writes:
gamemode player1 0
On the CONSOLE
The script code for the test is something like this
if echo $line | grep -q 'gamemode'
if echo $line | grep -q ' 1'; then
echo $line | sed s/' 0'/' 1'/ >> stdin.commandlist
fi
fi
Minecraft Server is a java program which starts like this:
Java -Xmx2024M -Xms2024M -jar minecraft_server.jar nogui
174 recipes
27 achievements
2012-02-20 09:22:26 [INFO] Starting minecraft server version 1.1
2012-02-20 09:22:26 [INFO] Loading properties
2012-02-20 09:22:26 [INFO] Starting Minecraft server on 5.66.29.122:25565
2012-02-20 09:22:26 [INFO] Preparing level "world"
2012-02-20 09:22:26 [INFO] Default game type: 0
2012-02-20 09:22:27 [INFO] Preparing start region for level 0
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everyone,
Ive got a quick question about the feasibility and any suggestions for a shell script. I can use sh or ksh, doesnt matter. Basically, Ive got an output file from a db2 command that looks like so:
SCHEMA NAME CARD LEAF ELEAF LVLS ISIZE NDEL KEYS F4 F5 ... (3 Replies)
Discussion started by: rdudejr
3 Replies
2. Programming
anybody knows the metod to clear the unix console? (1 Reply)
Discussion started by: iAlex
1 Replies
3. Shell Programming and Scripting
I would like to write shell/perl script which identifies the top unix processes that are performing high disk I/O's or/and writes
If any one knows the solution please help me?
-Swamy (0 Replies)
Discussion started by: avsswamy
0 Replies
4. UNIX for Advanced & Expert Users
Guys,
Is there any UNIX command that captures the 'Unix process which is performing high disk I/O reads and writes'.
can you help me in this?
-Swamy (6 Replies)
Discussion started by: avsswamy
6 Replies
5. Filesystems, Disks and Memory
Hi,
I am trying to find the reliability of 'vmstat -d' for showing the actual physical writes on sectors on hard disk.
Can anyone please tell me if the numbers in the "sectors" field under "read" or "write" headers show a count of the actual write commands sent to disk from the low level... (2 Replies)
Discussion started by: jake24
2 Replies
6. Filesystems, Disks and Memory
Hi All
I was wondering how the copying of vast amounts of data affected the overall lifespan of an HDD.
In my example, I'm copying approx 120GB (250,000) of files, once per hour from disk to another.
Is this likely to have a detrimental effect on the disk in terms of reads/writes etc?
... (2 Replies)
Discussion started by: huskie69
2 Replies
7. UNIX for Dummies Questions & Answers
I was analyzing the Disk read using hdparm utility.
This is what i got as a result.
# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 108 MB in 3.04 seconds = 35.51 MB/sec
# hdparm -T /dev/sda
/dev/sda:
Timing cached reads: 3496 MB in 1.99 seconds = 1756.56 MB/sec... (1 Reply)
Discussion started by: pinga123
1 Replies
8. Shell Programming and Scripting
existing code
#!/bin/bash
SRC_DIR=/home/brian/mc/
DEST_DIR=/home/brian/mcbak/
SCREEN_SESSION=minecraft
BACKUP_LOG=/home/brian/mcbaklog
CHKBAK=$(rdiff-backup -v3 --verify ~/mcbak)
BAKSZ=$(du -sh ~/mcbak|awk 'FNR == 1 {print $1}')
WLDSZ=$(du -sh ~/mc/world/|awk 'FNR == 1 {print $1}')... (1 Reply)
Discussion started by: briandanielz
1 Replies
9. SCO
I installed the Java 1.4.2_19 JRE, SDK, and Mozilla plugin in SCO (OpenServer 5.0.7). However, every time I try and view the java console, the browser immediately closes. Likewise, if I navigate to a website that tries to load an applet, the browser immediately closes.
I've checked and... (1 Reply)
Discussion started by: jdsnatl
1 Replies
10. Windows & DOS: Issues & Discussions
my kids are on minecraft constantly. I want to restrict its use but it seems impossible since it runs on java. :eek:
They are using :mad: windows 7 :mad: but I'm asking this question on here since Java is platform independent (er right?):confused: Also this forum was very helpful with my AWK... (10 Replies)
Discussion started by: cmp260
10 Replies
LEARN ABOUT DEBIAN
pioneers-server-console
pioneers-server-console(6) Games Manual pioneers-server-console(6)
NAME
pioneers-server-console - command-line game server for Pioneers
SYNOPSIS
pioneers-server-console [ OPTIONS ]
DESCRIPTION
This manual page documents briefly the pioneers-server-console command.
Pioneers is an implementation of the popular, award-winning "Settlers of Catan" board game for the GNOME desktop environment. It uses a
client/server model for networked play of between two and eight players. This program provides a console-only server that pioneers clients
can connect to.
OPTIONS
Application options
-g,--game-title game title Load the ruleset specified by game title. The title can be found in the *.game files. You need quotes for titles
with spaces.
--filefilename
Load the ruleset in the file filename.
-p,--port port
Use port port for player connections.
-P,--players num
Start a game for num total players (including computer players).
-v,--points points
Specify the number of "victory points" required to win the game.
-R,--seven-rule[0|1|2]
"Sevens rule": Specify gameplay behavior when a player rolls a seven. A value of 0 (the default) means that rolling a seven always
moves the robber. A value of 1 requires the player to re-roll if a seven is rolled on the first two turns. A value of 2 means the
player always re-rolls.
-T,--terrain[0|1]
Choose a terrain type: 0 for the default, or 1 for random terrain.
-c,--computer-players num
Start up num computer players.
--version
Show version information.
Meta-server options
-r,--register
Register with a meta server. The meta server to use can be overridden with the -m option. Default meta sever: pioneers.debian.net
-m,--meta-server metaserver
Register this server with the metaserver at the specified address.
-n, --hostname hostname
Use this hostname instead of the hostname reported by hostname(1).
Miscellaneous options
-x,--auto-quit Automatically exit after a player has won.
-k,--empty-timeout secs
Automatically stop the server if no one has connected after secs seconds.
-t,--tournament mins
Tournament mode: add AI players after mins minutes.
-a,--admin-port port
Listen for administrative commands on port port.
-s,--admin-wait
Don't start the game immediately; wait for a command on the admin port (-a) instead.
--fixed-seating-order
Give players numbers according to the order they enter the game.
--debug
Enable debug messages.
ENVIRONMENT
The default settings of the server can be influenced with the following three environment variables:
PIONEERS_META_SERVER
The hostname of the meta-server when no meta-server is specified on the command-line.
PIONEERS_SERVER_NAME
The hostname of the server. If it is not set, the hostname is determined by hostname(1).
PIONEERS_DIR
The path to the game definition files. If it is not set, the default installation path will be used.
FILES
/usr/share/games/pioneers/*.game and $XDG_DATA_HOME/pioneers/*.game
Game definitions
/usr/share/games/pioneers/computer_names
A list of names the computer player can use
AUTHOR
This manual page was written by Steve Langasek <vorlon@debian.org>, and updated by Roland Clobus <rclobus@rclobus.nl>. Pioneers was writ-
ten by Dave Cole <dave@dccs.com.au>, Andy Heroff <aheroff@mediaone.net>, and Roman Hodek <roman@hodek.net>, with contributions from many
other developers on the Internet; see the AUTHORS file in the pioneers distribution for a complete list of contributing authors.
SEE ALSO
pioneers(6), pioneers-server-gtk(6), pioneersai(6), hostname(1)
pioneers January 8, 2012 pioneers-server-console(6)