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 SUSE
installsieve
INSTALLSIEVE(1) General Commands Manual INSTALLSIEVE(1)
*
NAME
installsieve - user utility for managing sieve scripts
SYNOPSIS
installsieve
DESCRIPTION
installsieve is a utility that allows users to manage their sieve scripts kept on the server.
OPTIONS
-v <name> View script with the given name. The script if retrieved sucessfully is output to standard output.
-l List all of the scripts currently on the server. If one of the scripts is active a arrow is printed indicating that it is the active
script.
-p <port> Port to connect to. If left off this defaults to "sieve" as defined in /etc/services.
-i <file> Install a file onto the server. If a script with the same name already exists on the server it is overwritten. Upon sucessfully
putting the script on the server the script is set active. If <file> has the extension .script it is chopped when put on the server since
sieve names may not contain a '.'.
-a <name> Set <name> as the active script. The list of available names can be obtained from the '-l' option..
-d <name> Delete the sieve script on the server with <name>.
-m <mechanism> Force installsieve to use <mechanism> for authentication. If not specified the strongest authentication mechanism is chosen.
-g <name> Get the sieve script with <name> and save it to disk with a ".script" extension. If a file with that name already exists it is
overwritten.
-u <user> Userid/Authname to use for authentication; by default, the current user.
CMU
Project Cyrus INSTALLSIEVE(1)