Advertisement
smbarbour

Untitled

May 25th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.12 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. use strict;
  3.  
  4. print "Enter output filename: ";
  5. my $file = <>;
  6. chomp($file);
  7. print $file . "\n";
  8.  
  9. open OUT, ">$file";
  10.  
  11. my $startX;
  12. my $startY;
  13. my $startZ;
  14. my $sizeX;
  15. my $sizeY;
  16. my $sizeZ;
  17. my $bufferX;
  18. my $bufferZ;
  19. my $plotsX;
  20. my $plotsZ;
  21. my $world;
  22. my $plotName;
  23. my $owner;
  24. my $input;
  25.  
  26. print "Enter the world name: ";
  27. $world = <>;
  28. chomp($world);
  29. print "Starting X coordinate: ";
  30. $startX = <>;
  31. chomp($startX);
  32. print "Starting Y coordinate: ";
  33. $startY = <>;
  34. chomp($startY);
  35. print "Starting Z coordinate: ";
  36. $startZ = <>;
  37. chomp($startZ);
  38. print "Size of plots on X axis: ";
  39. $sizeX = <>;
  40. chomp($sizeX);
  41. print "Size of plots on Y axis: ";
  42. $sizeY = <>;
  43. chomp($sizeY);
  44. print "Size of plots on Z axis: ";
  45. $sizeZ = <>;
  46. chomp($sizeZ);
  47. print "Blocks between plots on X axis: ";
  48. $bufferX = <>;
  49. chomp($bufferX);
  50. print "Blocks between plots on Z axis: ";
  51. $bufferZ = <>;
  52. chomp($bufferZ);
  53. print "Number of plots on X axis: ";
  54. $plotsX = <>;
  55. chomp($plotsX);
  56. print "Number of plots on Z axis: ";
  57. $plotsZ = <>;
  58. chomp($plotsZ);
  59. print "Default owner name: ";
  60. $owner = <>;
  61. chomp($owner);
  62.  
  63. my $plotID = 1;
  64. print OUT "Residences:\n";
  65. for (my $currentX = 0; $currentX < $plotsX; $currentX++ ) {
  66.     for (my $currentZ = 0; $currentZ < $plotsZ; $currentZ++ ) {
  67.         $plotName = "Plot_$plotID";
  68.         print OUT "  $plotName:\n";
  69.         print OUT "    EnterMessage: Welcome %player to %residence, owned by %owner\n";
  70.         print OUT "    BlackList:\n";
  71.         print OUT "      Type: BLACKLIST\n";
  72.         print OUT "      ItemList: []\n";
  73.         print OUT "    LeaveMessage: Now leaving %residence.\n";
  74.         print OUT "    IgnoreList:\n";
  75.         print OUT "      Type: IGNORELIST\n";
  76.         print OUT "      ItemList: []\n";
  77.         print OUT "    Areas:\n";
  78.         print OUT "      main:\n";
  79.         print OUT "        X1: " . ($currentX * ($sizeX + $bufferX) + $startX) . "\n";
  80.         print OUT "        Y1: " . $startY . "\n";
  81.         print OUT "        Z1: " . ($currentZ * ($sizeZ + $bufferZ) + $startZ) . "\n";
  82.         print OUT "        X2: " . ($currentX * ($sizeX + $bufferX) + $startX + $sizeX) . "\n";
  83.         print OUT "        Y2: " . ($startY + $sizeY) . "\n";
  84.         print OUT "        Z2: " . ($currentZ * ($sizeZ + $bufferZ) + $startZ + $sizeZ) . "\n";
  85.         print OUT "    Subzones: {}\n";
  86.         print OUT "    Permissions:\n";
  87.         print OUT "      PlayerFlags:\n";
  88.         print OUT "        $owner:\n";
  89.         print OUT "          container: true\n";
  90.         print OUT "          ignite: true\n";
  91.         print OUT "          use: true\n";
  92.         print OUT "          build: true\n";
  93.         print OUT "          move: true\n";
  94.         print OUT "      GroupFlags: {}\n";
  95.         print OUT "      AreaFlag:\n";
  96.         print OUT "        pvp: false\n";
  97.         print OUT "        firespread: false\n";
  98.         print OUT "        container: false\n";
  99.         print OUT "        tnt: false\n";
  100.         print OUT "        ignite: false\n";
  101.         print OUT "        piston: false\n";
  102.         print OUT "        use: false\n";
  103.         print OUT "        creeper: false\n";
  104.         print OUT "        flow: false\n";
  105.         print OUT "        build: false\n";
  106.         print OUT "      Owner: $owner\n";
  107.         print OUT "      World: $world\n";
  108.         print OUT "    StoredMoney: 0\n";
  109.         $plotID++;
  110.     }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement