Thursday, August 30, 2007

Multiregion setup helper ruby script

Oh, and before I forgot - here's a sample ruby script for you to create the few regions and
few users.
Place it in your bin directory and it will help create a few files for you.


require 'digest/md5'

999.upto(1001) do |x|
999.upto(1001) do |y|
name = "sim x#{x} y#{y}"
port = 9000 + (x-1000)*100 + (y-1000)
uuid = Digest::MD5.hexdigest(name)
File.open("Regions/x#{x}-y#{y}.xml", "w") do |f|
f.print <<__EE__



__EE__
end
end
end

File.open("startup_commands.txt", "w") do |f|
f.print "terrain fill 21\n"
end

# to create users, use "command-script users.txt" when loading the first time.

File.open("users.txt", "w") do |f|
"a".upto("z") do |u|
f.print "create user Test#{u} User test 1000 1000\n"
end
end

No comments: