bigfoot49211

Untitled

Dec 18th, 2015
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.68 KB | None | 0 0
  1. options:
  2. p: &8[&3Walls&8]
  3.  
  4. # dynamic time span scaling, don't change if you don't know how it works
  5. scaleMax: 0.045
  6. scaleMin: 0.005
  7. scalePlayers: 30
  8.  
  9. # how long to wait between progress notifications
  10. notify-delay: 3 seconds
  11.  
  12. # name of spawn world
  13. spawn-world: spawn
  14.  
  15. command /setwalls <world> <int> [<int=0>] [<int=0>] [<item=bedrock>] [<number>] [<item>]:
  16. permission: skript.setwalls
  17. usage: /setwalls <world> <radius> [<center x>] [<center z>] [<block>]
  18. trigger:
  19. if "%arg 1%" is "{@spawn-world}":
  20. message "{@p} &7http://i.imgur.com/pTcKZvJ.jpg"
  21. stop
  22.  
  23. # time for catch-up/notify checking
  24. set {_time.tick} to now
  25. set {_time.notify} to now
  26. set {_time.start} to now
  27.  
  28. # corner bottom blocks
  29. set {_r} to arg 2+0.5
  30. set {_++} to (block at location at {_r}+(arg 3), 0.5, {_r}+(arg 4) of the world arg-1)
  31. set {_+-} to (block at location at {_r}+(arg 3), 0.5, 0-{_r}+(arg 4) of the world arg-1)
  32. set {_--} to (block at location at 0-{_r}+(arg 3), 0.5, 0-{_r}+(arg 4) of the world arg-1)
  33. set {_-+} to (block at location at 0-{_r}+(arg 3), 0.5, {_r}+(arg 4) of the world arg-1)
  34.  
  35. # counters for progress
  36. set {_processed} to 0
  37. set {_total} to ((arg 2)*2-1)*4
  38.  
  39. if arg 6 is not set:
  40. # dynamic tick time calculation
  41. set {_playerCount} to size of all players
  42. if {_playerCount} > {@scalePlayers}:
  43. set {_playerCount} to {@scalePlayers}
  44. # MATHZ
  45. set {_seconds} to {@scaleMax}-({@scaleMax}-{@scaleMin})*({_playerCount}/{@scalePlayers})
  46. set {_usage} to 100*{_seconds}/0.05
  47. set {_maxTime} to "%{_seconds}% seconds" parsed as timespan
  48. else:
  49. # forced time
  50. set {_usage} to arg 6
  51. set {_maxTime} to "%{_usage}*0.0005% seconds" parsed as timespan
  52.  
  53. message "{@p} &cGeneration started by &e%command sender%&7!" to all ops
  54. message "{@p} &7World: &9%arg 1% &r &r &r &r &r &r &7Block: &9%arg 5% &r &r &r &r &r &r &7Usage:" to all ops
  55. message "{@p} &7Radius/Center: &9%arg 2%&7@&9%arg 3%&7,&9%arg 4% &7(&9%arg 2*2%²&7) &r &r &r &r &9%{_usage}%%%" to all ops
  56.  
  57. loop blocks from {_++} to {_+-}:
  58. loop blocks from loop-block to block 255 above loop-block:
  59. if arg 7 is set:
  60. chance of 50%:
  61. set loop-block-2 to arg 5
  62. else:
  63. set loop-block-2 to arg 7
  64. else:
  65. set loop-block-2 to arg 5
  66.  
  67. set {_processed} to {_processed}+1
  68.  
  69. if {_time.tick} was more than {_maxTime} ago:
  70. wait 1 tick
  71. set {_time.tick} to now
  72. if {_time.notify} was more than {@notify-delay} ago:
  73. message "{@p} &7Progress in &9%arg 1%&7: &5%100*{_processed}/{_total}%%%&7!" to all ops
  74. set {_time.notify} to now
  75.  
  76. loop blocks from {_+-} to {_--}:
  77. loop blocks from loop-block to block 255 above loop-block:
  78. if arg 7 is set:
  79. chance of 50%:
  80. set loop-block-2 to arg 5
  81. else:
  82. set loop-block-2 to arg 7
  83. else:
  84. set loop-block-2 to arg 5
  85.  
  86. set {_processed} to {_processed}+1
  87.  
  88. if {_time.tick} was more than {_maxTime} ago:
  89. wait 1 tick
  90. set {_time.tick} to now
  91. if {_time.notify} was more than {@notify-delay} ago:
  92. message "{@p} &7Progress in &9%arg 1%&7: &5%100*{_processed}/{_total}%%%&7!" to all ops
  93. set {_time.notify} to now
  94.  
  95. loop blocks from {_--} to {_-+}:
  96. loop blocks from loop-block to block 255 above loop-block:
  97. if arg 7 is set:
  98. chance of 50%:
  99. set loop-block-2 to arg 5
  100. else:
  101. set loop-block-2 to arg 7
  102. else:
  103. set loop-block-2 to arg 5
  104.  
  105. set {_processed} to {_processed}+1
  106.  
  107. if {_time.tick} was more than {_maxTime} ago:
  108. wait 1 tick
  109. set {_time.tick} to now
  110. if {_time.notify} was more than {@notify-delay} ago:
  111. message "{@p} &7Progress in &9%arg 1%&7: &5%100*{_processed}/{_total}%%%&7!" to all ops
  112. set {_time.notify} to now
  113.  
  114. loop blocks from {_-+} to {_++}:
  115. loop blocks from loop-block to block 255 above loop-block:
  116. if arg 7 is set:
  117. chance of 50%:
  118. set loop-block-2 to arg 5
  119. else:
  120. set loop-block-2 to arg 7
  121. else:
  122. set loop-block-2 to arg 5
  123.  
  124. set {_processed} to {_processed}+1
  125.  
  126. if {_time.tick} was more than {_maxTime} ago:
  127. wait 1 tick
  128. set {_time.tick} to now
  129. if {_time.notify} was more than {@notify-delay} ago:
  130. message "{@p} &7Progress in &9%arg 1%&7: &5%100*{_processed}/{_total}%%%&7!" to all ops
  131. set {_time.notify} to now
  132.  
  133. message "{@p} &aFinished in &9%arg 1%&a! &7(%difference between {_time.start} and now%)" to all ops
Advertisement
Add Comment
Please, Sign In to add comment