Advertisement
fleft17

Untitled

Sep 14th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. options:
  2.  
  3. P: &8[&7Pregen&8]
  4. CC: &a
  5. HC: &6
  6. Pregen.TP.Delay: 1 ticks
  7. Correct.Usage: /pregen <radius> <world>
  8. Broadcast.Messages: true
  9. WB.Fill.Speed: 100
  10.  
  11. command /pregen [<integer>] [<world>]:
  12. permission: skript.op
  13. trigger:
  14. if {Pregen::Running} is true:
  15. if arg-1 is not set:
  16. delete {Pregen::Running}
  17. stop trigger
  18. else:
  19. message "{@P}{@CC} {@Correct.Usage}"
  20. if arg-1 is less than 16:
  21. message "{@P}{@CC} You cannot pregen with a radius less than 16!"
  22. stop trigger
  23. if arg-2 is not set:
  24. message "{@P}{@CC} {@Correct.Usage}"
  25. stop trigger
  26. loop 3 times:
  27. command "/pregen-sound note.harp"
  28. wait 4 ticks
  29. command sender command "/wb set %arg-1%"
  30. broadcast "{@P}{@CC}&r&k----------------------------------"
  31. broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
  32. broadcast "{@P}{@CC} Beginning pregen! There may be lag! Do not log out!"
  33. broadcast "{@P}{@HC} Pregen Skript by Fleft"
  34. broadcast "{@P}{@CC}&r&k----------------------------------"
  35. set command sender's gamemode to creative
  36. set {Pregen::Running} to true
  37. set {Pregen::Radius} to arg-1
  38. set {Pregen::World} to arg-2
  39. set {Pregen::Loop.1} to 0
  40. set {Pregen::Loop.2} to 0
  41. set {Pregen::Count} to 0
  42. set {Pregen::Time} to 0
  43. set {Pregen::Notify} to now
  44. wait 1 second
  45. set {_count} to 3
  46. loop 3 times:
  47. broadcast "{@P}{@CC} Starting:{@HC} %{_count}%..."
  48. command "/pregen-sound note.harp"
  49. subtract 1 from {_count}
  50. wait 1 second
  51. loop ({Pregen::Radius}*2) times:
  52. add 1 to {Pregen::Loop.1}
  53. if {Pregen::Loop.1} is equal to 16:
  54. set {Pregen::Time} to rounded down ((loop-number-1)/{Pregen::Radius})*50
  55. if {@Broadcast.Messages} is true:
  56. if {Pregen::Notify} was more than 5 seconds ago:
  57. broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
  58. set {Pregen::Notfy} to now
  59. command "/pregen-sound note.harp"
  60. set {Pregen::Loop.1} to 0
  61. loop ({Pregen::Radius}*2) times:
  62. {Pregen::Running} is not set:
  63. delete {Pregen::*}
  64. broadcast "{@P}{@HC} Cancelled!"
  65. command "/pregen-sound random.break"
  66. wait 5 ticks
  67. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  68. while (block at {Pregen::Location}) is air:
  69. set {Pregen::Location} to location 1 below {Pregen::Location}
  70. if y-coordinate of {Pregen::Location} is less than 5:
  71. message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  72. wait 1 tick
  73. teleport command sender to (location 1 above {Pregen::Location})
  74. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  75. delete {Pregen::Location}
  76. stop trigger
  77. add 1 to {Pregen::Loop.2}
  78. if {Pregen::Loop.2} is equal to 16:
  79. set {Pregen::Loop.2} to 0
  80. set {Pregen::x.coord} to ((loop-number-1)-{Pregen::Radius})
  81. set {Pregen::z.coord} to ((loop-number-2)-{Pregen::Radius})
  82. set {Pregen::Location} to (location at ({Pregen::x.coord}, 200, {Pregen::z.coord}) of the world ({Pregen::World}))
  83. while (block at {Pregen::Location}) is air:
  84. set {Pregen::Location} to location 1 below {Pregen::Location}
  85. if y-coordinate of {Pregen::Location} is less than 5:
  86. if {@Broadcast.Messages} is true:
  87. broadcast "{@P}{@CC} Void: skipping location"
  88. delete {Pregen::Location}
  89. if command sender is not online:
  90. broadcast "{@P}{@CC} Pregenning interrupted. {@HC}%command sender%{@CC} logged out."
  91. delete {Pregen::Running}
  92. teleport command sender to (location 1 above {Pregen::Location})
  93. add 1 to {Pregen::Time}
  94. wait {@Pregen.TP.Delay}
  95. broadcast "{@P}{@CC} Pregenning finished: ~{@HC}%{Pregen::Time}/16% seconds."
  96. delete {Pregen::*}
  97. set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
  98. while (block at {Pregen::Location}) is air:
  99. set {Pregen::Location} to location 1 below {Pregen::Location}
  100. if y-coordinate of {Pregen::Location} is less than 5:
  101. broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
  102. delete {Pregen::Location}
  103. wait 1 tick
  104. teleport command sender to (location 1 above {Pregen::Location})
  105. message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
  106. command sender command "/wb set %arg-1%"
  107. wait 1 tick
  108. command sender command "/wb fill {@WB.Fill.Speed}"
  109. wait 1 tick
  110. command sender command "/wb fill confirm"
  111. loop 3 times:
  112. command "/pregen-sound note.harp"
  113. wait 3 ticks
  114. broadcast "{@P}{@CC}&r&k----------------------------------"
  115. broadcast "{@P}{@CC} Automatically finishing pregen using"
  116. broadcast "{@P}{@HC} WorldBorder!{@CC} May be small lag!"
  117. broadcast "{@P}{@CC}&r&k----------------------------------"
  118. execute console command "/pregen-sound random.explode"
  119.  
  120.  
  121. command /pregen-sound <text>:
  122. permission: skript.pregen
  123. trigger:
  124. loop all players:
  125. execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement