The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
jwrap
Posted by: Jwrap | August 23, 2010 @ 5:04pm
Revision 1 - Original post on August 23, 2010 @ 5:04pm
Python Code
[
Download
]
import subprocess, string, time args = 'java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui'.split() p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) thetime = time.time() print thetime #Watch and interface with the server while(True): if time.time() >= thetime + 5: thetime = time.time() p.stdin.write("say Saving...\n") time.sleep(1) p.stdin.write("save-all\n") p.stdin.write("say Map saved.\n") time.sleep(0.1) p.stderr.readline() log = p.stderr.readline() words = log.split() print log.strip() time.sleep(0.2) print 'Script shutdown complete!'
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.47 / 8
58 Votes