Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 72.17 KB | None | 0 0
  1. options:
  2.  
  3. #--------------------------------------------------#
  4. # Config/Options #
  5. #--------------------------------------------------#
  6.  
  7. P: <Cyan>[<gray>UHC<cyan>]
  8. # Prefix! Ex: (Prefix)&c&lScatter &8» (Main Chat Color)Everyone is now invisible!
  9.  
  10. C: &9
  11. # Main chat color! Ex: (Prefix)&c&lScatter &8» (Main Chat Color)The scatter is now (Highlight Chat Color)complete!
  12.  
  13. H: &7
  14. # Highlight chat color! Ex: (Prefix)&c&lScatter &8» (Highlight Chat Color)You (Main Chat Color)were scattered!
  15.  
  16. BC: &7
  17. # Bracket, colon, and etc. color, it is this "[]" and ":" in chat!
  18.  
  19. Permission: skript.scatter
  20. # The permission you give ops/hosts/staff/etc. to use all of the commands!
  21.  
  22. SEMTAp: true # Stands for "Send extra messages (action bar) to all players" **NOTE THIS DOES NOT INCLUDE THE TPS READING THAT IS ANOTHER OPTION!**
  23. # Would you like to send extra messages (action bar) to all players? (Example: Scatter » NatePlays was scattered! [1/1] & Scatter » Loading chunks » [1/1]) (Use "true" or "false")
  24.  
  25. TPSR: true # Stands for "Send TPS readings to ops"
  26. # Would you like to send tps readings to ops? *Suggested you set this to "true"* (Use "true" or "false")
  27.  
  28. Sounds: true
  29. # Do you want some great sounds?
  30.  
  31. ScatterSound: random.pop
  32. # The main sound in the scatter!
  33.  
  34. Tries: 1001
  35. # I do not suggest changing this!
  36.  
  37. LoadGeneratedChunks: true
  38. # Ummm, load the generated chunks? This helps A LOT, HIGHLY suggested to use! Helps TPS on 99.99% of servers! (Use "true" or "false")
  39.  
  40. Vanish: true
  41. # Vanish players while scattering? This helps TPS on 90% of servers! (HIGHLY SUGGESTED TO USE THIS OPTION) (Use "true" or "false") **Requires SimpleVanish plugin**
  42.  
  43. Butcher: true
  44. # Butch mobs while scattering? (HIGHLY SUGGESTED TO USE THIS OPTION) (Use "true" or "false") **Requires Essentials**
  45.  
  46. MobSpawning: true
  47. # Should mobs spawn while scattering? I suggest you set this to "true", but if you have horrible provider, like McProHosting (or just on a bad Minecrafted node :/) set it to "false" (Use "true" or "false")
  48.  
  49. UnitRatePlayers: 200
  50. # The unit rate number in player amount!
  51. # Example: I want to wait 10 ticks between each chunk & 1 tick between each scatter of a player, with a 100 player fill in a FFA game,
  52. # so I would set this option to 100, the next to 10, and the one after that one to 1!
  53.  
  54. UnitRateChunks: 10
  55. # The amount of ticks between each chunk to be loaded with the unit rate!**Use Ticks**
  56. # Example: I have 200 players in a FFA game, and my options are default in this config, then the math is 10/100*200, which equals 20 ticks,
  57. # so the chunkload player waits 20 ticks (1 second) before the chunkload player is teleported to the next chunk!
  58.  
  59. UnitRateScatter: 1
  60. # The amount of ticks between each player to be scattered with the unit rate! **Use Ticks**
  61. # Example: I have 200 players in a FFA game, and my options are default in this config, then the math is 1/100*200, which equals 2 ticks,
  62. # so we wait 2 ticks, before the next player is scattered! (This does not effect the five second wait!)
  63.  
  64. ScaTimes: 10
  65. # The amount of players gets scattered, then you wait 5 seconds for the next amount of players to be scattered!
  66.  
  67. SpecVariable: {Spectator::*}
  68. # Your spectating variable, if you are using a skript, if your using a plugin then this is worthless, ignore it!
  69.  
  70. Version: 5.2
  71. # Don't change this
  72.  
  73. #--------------------------------------------------#
  74. # Main Command #
  75. #--------------------------------------------------#
  76.  
  77. command /sca [<world>] [<integer>] [<text>] [<integer>] [<integer>] [<integer>] [<integer>] [<integer>]:
  78. aliases: /teamsscatter, /scatterall, /teamscatter
  79. permission: {@Permission}
  80. trigger:
  81.  
  82. #--------------------------------------------------#
  83. # Arguments #
  84. #--------------------------------------------------#
  85.  
  86. if arg-1 is not set:
  87. send "{@P}{@H} /sca {@BC}<{@H}world{@BC}> <{@H}radius{@BC}> <{@H}*/teams/player{@BC}> {@BC}[{@C}Mindist{@BC}] [{@C}X-Coordinate{@BC}] [{@C}Z-Coordinate{@BC}] [{@C}Chunk Load Ticks{@BC}] [{@C}Scatter Ticks{@BC}]"
  88. command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
  89. stop trigger
  90. else if arg-2 is not set:
  91. send "{@P}{@H} /sca {@BC}<{@H}world{@BC}> <{@H}radius{@BC}> <{@H}*/teams/player{@BC}> {@BC}[{@C}Mindist{@BC}] [{@C}X-Coordinate{@BC}] [{@C}Z-Coordinate{@BC}] [{@C}Chunk Load Ticks{@BC}] [{@C}Scatter Ticks{@BC}]"
  92. command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
  93. stop trigger
  94. else if arg-3 is not set:
  95. send "{@P}{@H} /sca {@BC}<{@H}world{@BC}> <{@H}radius{@BC}> <{@H}*/teams/player{@BC}> [{@C}Mindist{@BC}] [{@C}X-Coordinate{@BC}] [{@C}Z-Coordinate{@BC}] [{@C}Chunk Load Ticks{@BC}] [{@C}Scatter Ticks{@BC}]"
  96. command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
  97. stop trigger
  98.  
  99. #--------------------------------------------------#
  100. # FFA/Solo Scatter #
  101. #--------------------------------------------------#
  102.  
  103. if arg-3 is "all" or "*":
  104. if command sender is console:
  105. stop trigger
  106. set {Scatter.Scattering} to true
  107. set {_ToScatter::*} to (all players)
  108. loop all players:
  109. {@SpecVariable} is true
  110. remove loop-player from {_ToScatter::*}
  111. set {_Size} to (size of {_ToScatter::*})
  112. if arg-4 is set:
  113. if arg-4 is equal to 0:
  114. set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
  115. if arg-2 is less than {_Mindist}:
  116. set {_Mindist} to argument 2-100
  117. else if arg-2 is less than 1:
  118. set {_Mindist} to argument 2-100
  119. else:
  120. set {_Mindist} to arg-4
  121. else:
  122. set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
  123. if arg-2 is less than {_Mindist}:
  124. set {_Mindist} to argument 2-100
  125. else if arg-2 is less than 1:
  126. set {_Mindist} to argument 2-100
  127. if arg-5 is set:
  128. set {_X} to arg-5
  129. else:
  130. set {_X} to 0
  131. if arg-6 is set:
  132. set {_Z} to arg-6
  133. else:
  134. set {_Z} to 0
  135. if arg-7 is set:
  136. set {_ChunkLoadTicks} to arg-7
  137. else:
  138. set {_ChunkLoadTicks} to round({@UnitRateChunks}/{@UnitRatePlayers}*{_Size})
  139. if arg-8 is set:
  140. set {_ScatterTicks} to arg-8
  141. else:
  142. set {_ScatterTicks} to round({@UnitRateScatter}/{@UnitRatePlayers}*{_Size})
  143. if {_ChunkLoadTicks} is 0:
  144. set {_ChunkLoadTicks} to 1
  145. if {_ScatterTicks} is 0:
  146. set {_ScatterTicks} to 1
  147. while (block at {_CMDLocB}) is air:
  148. set {_CMDLocB} to location 1 below {_CMDLocB}
  149. if y-coordinate of {_CMDLocB} is less than 3:
  150. set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
  151. wait 1 tick
  152. teleport the command sender to (location 1 above {_CMDLocB})
  153. if {@MobSpawning} is false:
  154. player command "/gamerule doMobSpawning false"
  155. set {_ApproxTime} to ({_Size}*({_ChunkLoadTicks}+{_ScatterTicks})/20)+(({_Size}/{@ScaTimes})*5)
  156. broadcast "{@P}{@C} Attempting to scatter {@BC}[{@H}%{_Size}%{@C}{@BC}] {@C}players around {@BC}[{@H}%{_X}%,%{_Z}%{@BC}]!"
  157. command "/scattersound"
  158. wait 2 ticks
  159. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  160. command "/scattersound"
  161. wait 2 ticks
  162. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  163. command "/scattersound"
  164. wait 2 ticks
  165. broadcast "{@P}{@C} This operation will take approximately {@H}%{_ApproxTime}% seconds!"
  166. command "/scattersound"
  167. loop ({_Size}) times:
  168. # if {Scatter.Cancel} is true:
  169. # exit loop
  170. loop {@Tries} times:
  171. if (loop-number-2) is {@Tries}:
  172. set {_Mindist} to 200
  173. loop ({_Size}) times:
  174. loop {@Tries} times:
  175. if (loop-number-2) is {@Tries}:
  176. broadcast "{@P}{@C}Couldn't scatter {@BC}[{@H}%({_Size})-(loop-number-1)%{@BC}/{@H}%{_Size}%{@BC}]{@C} players!"
  177. send "{@P} {@C}Locations couldn't be found! {@BC}[{@C}Too big of a {@H}mindist!{@BC}]"
  178. send "{@P} {@C}You may want to do {@H}/tpall!"
  179. command "/scatterbroke"
  180. stop trigger
  181. set {_Location.Good} to true
  182. set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
  183. loop ((loop-number-1)-1) times:
  184. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  185. delete {_Location.Good}
  186. if {_Location.Good} is true:
  187. set {_Location.GroundLevel} to {_Location.Sky}
  188. while (block at {_Location.GroundLevel}) is air:
  189. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  190. delete {_Location.Good}
  191. exit loop
  192. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  193. if {_Location.Good} is true:
  194. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  195. delete {_Location.Good}
  196. else:
  197. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  198. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  199. wait 1 tick
  200. exit 9 sections
  201. set {_Location.Good} to true
  202. set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
  203. loop ((loop-number-1)-1) times:
  204. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  205. delete {_Location.Good}
  206. if {_Location.Good} is true:
  207. set {_Location.GroundLevel} to {_Location.Sky}
  208. while (block at {_Location.GroundLevel}) is air:
  209. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  210. delete {_Location.Good}
  211. exit loop
  212. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  213. if {_Location.Good} is true:
  214. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  215. delete {_Location.Good}
  216. else:
  217. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  218. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  219. wait 1 tick
  220. exit loop
  221. loop {_ToScatter::*}:
  222. if {Scatter.Cancel} is true:
  223. exit loop
  224. set {Scatter.Scattering::%loop-value%} to true
  225. if {@Vanish} is true:
  226. if {Scatter.Cancel} is not set:
  227. command "/invis on"
  228. if {Scatter.Cancel} is not set:
  229. set {Scatter.DontUnloadChunks} to true
  230. broadcast ""
  231. set {_Time} to now
  232. set {_Size2} to {_Size}
  233. broadcast "{@P} {@C}Locations found! Starting the {@H}scatter {@C}process!"
  234. while {_Size2} is more than 0:
  235. if {Scatter.Cancel} is true:
  236. exit loop
  237. if {_Size2} is less than {@ScaTimes}+1:
  238. if {@LoadGeneratedChunks} is true:
  239. loop {_Size2} times:
  240. if command sender is not online:
  241. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  242. command "/scatterbroke"
  243. stop trigger
  244. add 1 to {_Chunks}
  245. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  246. if {@SEMTAp} is true:
  247. send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  248. if {@Butcher} is true:
  249. player command "/killall monsters"
  250. loop {_ChunkLoadTicks} times:
  251. wait 1 tick
  252. loop {_Size2} times:
  253. if {@LoadGeneratedChunks} is not true:
  254. if {@Butcher} is true:
  255. player command "/killall monsters"
  256. set {_Scatter.Player} to a random element out of {_ToScatter::*}
  257. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  258. remove {_Scatter.Player} from {_ToScatter::*}
  259. add 1 to {_Scattered}
  260. if {_Scatter.Player} is not online:
  261. if {_Scatter.Player} is "%command sender%":
  262. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  263. if {@SEMTAp} is true:
  264. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  265. else:
  266. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  267. if {@SEMTAp} is true:
  268. send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  269. else:
  270. if {_Scatter.Player} is "%command sender%":
  271. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  272. else:
  273. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  274. send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
  275. if {@SEMTAp} is true:
  276. send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  277. loop {_ScatterTicks} times:
  278. wait 1 tick
  279. set {_Size2} to 0
  280. exit loop
  281. else:
  282. if {@LoadGeneratedChunks} is true:
  283. loop {@ScaTimes} times:
  284. if command sender is not online:
  285. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  286. command "/scatterbroke"
  287. stop trigger
  288. add 1 to {_Chunks}
  289. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  290. if {@SEMTAp} is true:
  291. send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  292. if {@Butcher} is true:
  293. player command "/killall monsters"
  294. loop {_ChunkLoadTicks} times:
  295. wait 1 tick
  296. loop {@ScaTimes} times:
  297. if {@LoadGeneratedChunks} is not true:
  298. if {@Butcher} is true:
  299. player command "/killall monsters"
  300. set {_Scatter.Player} to a random element out of {_ToScatter::*}
  301. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  302. remove {_Scatter.Player} from {_ToScatter::*}
  303. remove 1 from {_Size2}
  304. add 1 to {_Scattered}
  305. if {_Scatter.Player} is not online:
  306. if {_Scatter.Player} is "%command sender%":
  307. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  308. if {@SEMTAp} is true:
  309. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  310. else:
  311. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  312. if {@SEMTAp} is true:
  313. send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  314. else:
  315. if {_Scatter.Player} is "%command sender%":
  316. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  317. else:
  318. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  319. send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
  320. if {@SEMTAp} is true:
  321. send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  322. loop {_ScatterTicks} times:
  323. wait 1 tick
  324. if {_Size2} is more than {@ScaTimes}:
  325. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_Size}%{@BC}] {@C}players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}{@ScaTimes}{@BC}] {@C}more players!"
  326. else:
  327. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_Size}%{@BC}] {@C}players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}%{_Size2}%{@BC}] {@C}more players!"
  328. command "/scattersound"
  329. set {_TPSStartTime} to now
  330. loop 5 times:
  331. wait 20 ticks
  332. if {@Butcher} is true:
  333. player command "/killall monsters"
  334. set {_TPSEndTime} to now
  335. set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
  336. set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
  337. replace all " seconds" in {_parsedText} with ""
  338. set {_TPSTime} to ("%{_parsedText}%" parsed as number)
  339. set {_tps} to (100/{_TPSTime})
  340. loop all entities in the player's world:
  341. add 1 to {_entites}
  342. if {_tps} is greater than 17.5:
  343. if {@TPSR} is true:
  344. send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
  345. else if {_tps} is greater than 15:
  346. if {@TPSR} is true:
  347. send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
  348. player command "/gamerule doMobSpawning false"
  349. else if {_tps} is greater than 10:
  350. if {@TPSR} is true:
  351. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
  352. player command "/killall all"
  353. else if {_tps} is greater than 1:
  354. if {@TPSR} is true:
  355. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
  356. player command "/killall all"
  357. else:
  358. if {@TPSR} is true:
  359. send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
  360. wait 1 tick
  361. if {Scatter.Cancel} is not set:
  362. broadcast ""
  363. broadcast "{@P}{@C} A total of {@BC}[{@H}%{_Scattered}%{@BC}] {@C}players scattered! Took {@H}%difference between {_Time} and now%!"
  364. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  365. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  366. broadcast "{@P}{@C} If you are stuck in a block, use {@H}/fix! {@C}Disabling the command in {@BC}[{@H}30{@BC}] {@H}seconds!"
  367. teleport command sender to {_CMDSender}
  368. set {_TPSStartTime} to now
  369. loop 5 times:
  370. wait 20 ticks
  371. if {@Butcher} is true:
  372. player command "/killall monsters"
  373. set {_TPSEndTime} to now
  374. set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
  375. set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
  376. replace all " seconds" in {_parsedText} with ""
  377. set {_TPSTime} to ("%{_parsedText}%" parsed as number)
  378. set {_tps} to (100/{_TPSTime})
  379. loop all entities in the player's world:
  380. add 1 to {_entites}
  381. if {_tps} is greater than 17.5:
  382. if {@TPSR} is true:
  383. send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
  384. else if {_tps} is greater than 15:
  385. if {@TPSR} is true:
  386. send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
  387. player command "/gamerule doMobSpawning false"
  388. else if {_tps} is greater than 10:
  389. if {@TPSR} is true:
  390. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
  391. player command "/killall all"
  392. else if {_tps} is greater than 1:
  393. if {@TPSR} is true:
  394. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
  395. player command "/killall all"
  396. else:
  397. if {@TPSR} is true:
  398. send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
  399. send "{@P}{@C} Killing all {@H}hostile mobs {@C}for {@BC}[{@H}1{@BC}] {@H}minute!" to all ops
  400. wait 1 tick
  401. set {Scatter.Fix} to true
  402. if {@Sounds} is true:
  403. loop all players:
  404. command "/playsound note.pling %loop-player%"
  405. loop 10 times:
  406. player command "/killall monsters"
  407. wait 1 second
  408. send "{@P}{@C} &cEnabling {@C}mob spawning, still {@H}butchering!" to all ops
  409. if {@Vanish} is true:
  410. command "/invis off"
  411. broadcast "{@P}{@H} Reappearing {@C}everyone! {@H}/Fix {@C}will be &cdisabled {@C}in {@BC}[{@H}15{@BC}] {@H}seconds!"
  412. player command "/gamerule doMobSpawning true"
  413. delete {Scatter.Scattering::*}
  414. delete {Scatter.DontUnloadChunks}
  415. loop 15 times:
  416. player command "/killall monsters"
  417. wait 1 second
  418. delete {Scatter.Fix}
  419. broadcast "{@P}{@H} /Fix {@C}is now &cdisabled{@BC}, {@C}don't try to use it!"
  420. set {_TPSStartTime} to now
  421. loop 5 times:
  422. wait 20 ticks
  423. if {@Butcher} is true:
  424. player command "/killall monsters"
  425. set {_TPSEndTime} to now
  426. set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
  427. set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
  428. replace all " seconds" in {_parsedText} with ""
  429. set {_TPSTime} to ("%{_parsedText}%" parsed as number)
  430. set {_tps} to (100/{_TPSTime})
  431. loop all entities in the player's world:
  432. add 1 to {_entites}
  433. if {_tps} is greater than 17.5:
  434. if {@TPSR} is true:
  435. send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
  436. else if {_tps} is greater than 15:
  437. if {@TPSR} is true:
  438. send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
  439. player command "/gamerule doMobSpawning false"
  440. else if {_tps} is greater than 10:
  441. if {@TPSR} is true:
  442. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
  443. player command "/killall all"
  444. else if {_tps} is greater than 1:
  445. if {@TPSR} is true:
  446. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
  447. player command "/killall all"
  448. else:
  449. if {@TPSR} is true:
  450. send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
  451. delete {Scatter.DontUnloadChunks}
  452. delete {Scatter.Scattering::*}
  453. delete {Scatter.Fix}
  454. delete {Scatter.Cancel}
  455. delete {Invis::*}
  456. delete {Scatter.Scattering}
  457. command "/invis off"
  458.  
  459. #--------------------------------------------------#
  460. # Team + Solo Scatter #
  461. #--------------------------------------------------#
  462.  
  463. else if arg-3 is "team" or "teams":
  464. if command sender is console:
  465. stop trigger
  466. set {_Count} to 0
  467. set {Scatter.Scattering} to true
  468. loop {Teams::*}:
  469. {Team.%loop-value%::*} is set
  470. increase {_Count} by 1
  471. add {_Count} to {_TeamsToScatter::*}
  472. set {_TeamScatter.%{_Count}%::*} to ({Team.%loop-value%::*})
  473. loop all players:
  474. {Teams.InTeam::%loop-player%} is not set
  475. add loop-player to {_Solos::*}
  476. loop all players:
  477. {@SpecVariable} is true
  478. remove loop-player from {_Solos::*}
  479. set {_TeamSize} to (size of {Teams::*})
  480. set {_SoloSize} to (size of {_Solos::*})
  481. set {_TeamSize2} to (size of {Teams::*})
  482. set {_SoloSize2} to (size of {_Solos::*})
  483. set {_Size} to ((size of {Teams::*})+(size of {_Solos::*}))
  484. if arg-4 is set:
  485. if arg-4 is equal to 0:
  486. set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
  487. if arg-2 is less than {_Mindist}:
  488. set {_Mindist} to argument 2-100
  489. else if arg-2 is less than 1:
  490. set {_Mindist} to argument 2-100
  491. else:
  492. set {_Mindist} to arg-4
  493. else:
  494. set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
  495. if arg-2 is less than {_Mindist}:
  496. set {_Mindist} to argument 2-100
  497. else if arg-2 is less than 1:
  498. set {_Mindist} to argument 2-100
  499. if arg-5 is set:
  500. set {_X} to arg-5
  501. else:
  502. set {_X} to 0
  503. if arg-6 is set:
  504. set {_Z} to arg-6
  505. else:
  506. set {_Z} to 0
  507. if arg-7 is set:
  508. set {_ChunkLoadTicks} to arg-7
  509. else:
  510. set {_ChunkLoadTicks} to round({@UnitRateChunks}/{@UnitRatePlayers}*{_Size})
  511. if arg-8 is set:
  512. set {_ScatterTicks} to arg-8
  513. else:
  514. set {_ScatterTicks} to round({@UnitRateScatter}/{@UnitRatePlayers}*{_Size})
  515. if {_ChunkLoadTicks} is 0:
  516. set {_ChunkLoadTicks} to 1
  517. if {_ScatterTicks} is 0:
  518. set {_ScatterTicks} to 1
  519. set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
  520. while (block at {_CMDLocB}) is air:
  521. set {_CMDLocB} to location 1 below {_CMDLocB}
  522. if y-coordinate of {_CMDLocB} is less than 3:
  523. set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
  524. wait 1 tick
  525. teleport the command sender to (location 1 above {_CMDLocB})
  526. if {@MobSpawning} is false:
  527. player command "/gamerule doMobSpawning false"
  528. set {_ApproxTime} to ({_Size}*({_ChunkLoadTicks}+{_ScatterTicks})/20)+(({_Size}/{@ScaTimes})*5)+3
  529. broadcast "{@P}{@C} Attempting to scatter {@BC}[{@H}%{_TeamSize}%{@BC}]{@C} teams & {@BC}[{@H}%{_SoloSize}%{@BC}] {@C}solos around {@H}%{_X}%,%{_Z}%!"
  530. command "/scattersound"
  531. wait 2 ticks
  532. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  533. command "/scattersound"
  534. wait 2 ticks
  535. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  536. command "/scattersound"
  537. wait 2 ticks
  538. broadcast "{@P}{@C} This operation will take approximately {@H}%{_ApproxTime}% seconds!"
  539. command "/scattersound"
  540. loop ({_Size}) times:
  541. if {Scatter.Cancel} is true:
  542. exit loop
  543. loop {@Tries} times:
  544. if (loop-number-2) is {@Tries}:
  545. set {_Mindist} to 200
  546. loop ({_Size}) times:
  547. loop {@Tries} times:
  548. if (loop-number-2) is {@Tries}:
  549. broadcast "{@P}{@C}Couldn't scatter {@BC}[{@H}%({_Size})-(loop-number-1)%{@BC}/{@H}%{_Size}%{@BC}]{@C} players!"
  550. send "{@P} {@C}Locations couldn't be found! {@BC}[{@C}Too big of a {@H}mindist!{@BC}]"
  551. send "{@P} {@C}You may want to do {@H}/tpall!"
  552. command "/scatterbroke"
  553. stop trigger
  554. set {_Location.Good} to true
  555. set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
  556. loop ((loop-number-1)-1) times:
  557. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  558. delete {_Location.Good}
  559. if {_Location.Good} is true:
  560. set {_Location.GroundLevel} to {_Location.Sky}
  561. while (block at {_Location.GroundLevel}) is air:
  562. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  563. delete {_Location.Good}
  564. exit loop
  565. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  566. if {_Location.Good} is true:
  567. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  568. delete {_Location.Good}
  569. else:
  570. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  571. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  572. wait 1 tick
  573. exit 9 sections
  574. set {_Location.Good} to true
  575. set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
  576. loop ((loop-number-1)-1) times:
  577. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  578. delete {_Location.Good}
  579. if {_Location.Good} is true:
  580. set {_Location.GroundLevel} to {_Location.Sky}
  581. while (block at {_Location.GroundLevel}) is air:
  582. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  583. delete {_Location.Good}
  584. exit loop
  585. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  586. if {_Location.Good} is true:
  587. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  588. delete {_Location.Good}
  589. else:
  590. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  591. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  592. wait 1 tick
  593. exit loop
  594. if {@Vanish} is true:
  595. if {Scatter.Cancel} is not set:
  596. command "/invis on"
  597. if {Scatter.Cancel} is not set:
  598. set {Scatter.DontUnloadChunks} to true
  599. broadcast ""
  600. set {_Time} to now
  601. broadcast "{@P} {@C}Locations found! Starting the {@H}scatter {@C}process!"
  602. loop {_ToScatter::*}:
  603. set {Scatter.Scattering::%loop-value%} to true
  604. while {_TeamSize} is more than 0:
  605. if {Scatter.Cancel} is true:
  606. exit loop
  607. if {Teams::*} is not set:
  608. exit loop
  609. if {_TeamSize} is less than {@ScaTimes}+1:
  610. if {@LoadGeneratedChunks} is true:
  611. loop {_TeamSize} times:
  612. if command sender is not online:
  613. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  614. command "/scatterbroke"
  615. stop trigger
  616. add 1 to {_Chunks}
  617. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  618. if {@SEMTAp} is true:
  619. send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  620. if {@Butcher} is true:
  621. player command "/killall monsters"
  622. loop {_ChunkLoadTicks} times:
  623. wait 1 tick
  624. loop {_TeamSize} times:
  625. if {@LoadGeneratedChunks} is not true:
  626. if {@Butcher} is true:
  627. player command "/killall monsters"
  628. set {_Scatter.Team} to a random element out of {_TeamsToScatter::*}
  629. remove {_Scatter.Team} from {_TeamsToScatter::*}
  630. add 1 to {_Scattered}
  631. add 1 to {_TotalScattered}
  632. loop {_TeamScatter.%{_Scatter.Team}%::*}:
  633. set {_Scatter.Player} to ("%loop-value-2%" parsed as offlineplayer)
  634. if {_Scatter.Player} is not online:
  635. if {_Scatter.Player} is "%command sender%":
  636. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  637. if {@SEMTAp} is true:
  638. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  639. else:
  640. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  641. if {@SEMTAp} is true:
  642. send action bar from "{@P}&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  643. else:
  644. if {_Scatter.Player} is "%command sender%":
  645. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  646. if {@SEMTAp} is true:
  647. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  648. else:
  649. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  650. send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
  651. if {@SEMTAp} is true:
  652. send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  653. loop {_ScatterTicks} times:
  654. wait 1 tick
  655. set {_TeamSize} to 0
  656. exit loop
  657. else:
  658. if {@LoadGeneratedChunks} is true:
  659. loop {@ScaTimes} times:
  660. if command sender is not online:
  661. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  662. command "/scatterbroke"
  663. stop trigger
  664. add 1 to {_Chunks}
  665. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  666. if {@SEMTAp} is true:
  667. send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  668. if {@Butcher} is true:
  669. player command "/killall monsters"
  670. loop {_ChunkLoadTicks} times:
  671. wait 1 tick
  672. loop {@ScaTimes} times:
  673. if {@LoadGeneratedChunks} is not true:
  674. if {@Butcher} is true:
  675. player command "/killall monsters"
  676. set {_Scatter.Team} to a random element out of {_TeamsToScatter::*}
  677. remove {_Scatter.Team} from {_TeamsToScatter::*}
  678. remove 1 from {_TeamSize}
  679. add 1 to {_Scattered}
  680. add 1 to {_TotalScattered}
  681. loop {_TeamScatter.%{_Scatter.Team}%::*}:
  682. set {_Scatter.Player} to ("%loop-value-2%" parsed as offlineplayer)
  683. if {_Scatter.Player} is not online:
  684. if {_Scatter.Player} is "%command sender%":
  685. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  686. if {@SEMTAp} is true:
  687. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  688. else:
  689. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  690. if {@SEMTAp} is true:
  691. send action bar from "{@P}&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  692. else:
  693. if {_Scatter.Player} is "%command sender%":
  694. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  695. if {@SEMTAp} is true:
  696. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  697. else:
  698. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  699. send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
  700. if {@SEMTAp} is true:
  701. send action bar from "{@P}{@H} %{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
  702. loop {_ScatterTicks} times:
  703. wait 1 tick
  704. if {_TeamSize} is more than 9:
  705. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}7{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}10{@BC}] {@C}more teams!"
  706. else:
  707. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}7{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}%{_TeamSize}%{@BC}] {@C}more teams!"
  708. command "/scattersound"
  709. set {_TPSStartTime} to now
  710. loop 5 times:
  711. wait 20 ticks
  712. if {@Butcher} is true:
  713. player command "/killall monsters"
  714. set {_TPSEndTime} to now
  715. set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
  716. set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
  717. replace all " seconds" in {_parsedText} with ""
  718. set {_TPSTime} to ("%{_parsedText}%" parsed as number)
  719. set {_tps} to (100/{_TPSTime})
  720. loop all entities in the player's world:
  721. add 1 to {_entites}
  722. if {_tps} is greater than 17.5:
  723. if {@TPSR} is true:
  724. send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
  725. else if {_tps} is greater than 15:
  726. if {@TPSR} is true:
  727. send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
  728. player command "/gamerule doMobSpawning false"
  729. else if {_tps} is greater than 10:
  730. if {@TPSR} is true:
  731. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
  732. player command "/killall all"
  733. else if {_tps} is greater than 1:
  734. if {@TPSR} is true:
  735. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
  736. player command "/killall all"
  737. else:
  738. if {@TPSR} is true:
  739. send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
  740. loop 2 times:
  741. wait 1 second
  742. if {@Butcher} is true:
  743. player command "/killall monsters"
  744. if {Teams::*} is set:
  745. if {Scatter.Cancel} is not set:
  746. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter solo players!"
  747. command "/scattersound"
  748. loop 5 times:
  749. wait 1 second
  750. if {@Butcher} is true:
  751. player command "/killall monsters"
  752. set {_Scattered.Teams} to {_Scattered}
  753. set {_Scattered} to 0
  754. while {_SoloSize} is more than 0:
  755. if {Scatter.Cancel} is true:
  756. exit loop
  757. if {_Solos::*} is not set:
  758. exit loop
  759. if {_SoloSize} is less than {@ScaTimes}+1:
  760. if {@LoadGeneratedChunks} is true:
  761. loop {_SoloSize} times:
  762. if command sender is not online:
  763. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  764. command "/scatterbroke"
  765. stop trigger
  766. add 1 to {_Chunks}
  767. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  768. if {@SEMTAp} is true:
  769. send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  770. if {@Butcher} is true:
  771. player command "/killall monsters"
  772. loop {_ChunkLoadTicks} times:
  773. wait 1 tick
  774. loop {_SoloSize} times:
  775. if {@LoadGeneratedChunks} is not true:
  776. if {@Butcher} is true:
  777. player command "/killall monsters"
  778. set {_Scatter.Player} to a random element out of {_Solos::*}
  779. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  780. remove {_Scatter.Player} from {_Solos::*}
  781. add 1 to {_Scattered}
  782. add 1 to {_TotalScattered}
  783. if {_Scatter.Player} is not online:
  784. if {_Scatter.Player} is "%command sender%":
  785. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  786. if {@SEMTAp} is true:
  787. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  788. else:
  789. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  790. if {@SEMTAp} is true:
  791. send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  792. else:
  793. if {_Scatter.Player} is "%command sender%":
  794. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  795. if {@SEMTAp} is true:
  796. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  797. else:
  798. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  799. send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
  800. if {@SEMTAp} is true:
  801. send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  802. loop {_ScatterTicks} times:
  803. wait 1 tick
  804. set {_SoloSize} to 0
  805. exit loop
  806. else:
  807. if {@LoadGeneratedChunks} is true:
  808. loop {@ScaTimes} times:
  809. if command sender is not online:
  810. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  811. command "/scatterbroke"
  812. stop trigger
  813. add 1 to {_Chunks}
  814. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  815. if {@SEMTAp} is true:
  816. send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
  817. if {@Butcher} is true:
  818. player command "/killall monsters"
  819. loop {_ChunkLoadTicks} times:
  820. wait 1 tick
  821. loop {@ScaTimes} times:
  822. if {@LoadGeneratedChunks} is not true:
  823. if {@Butcher} is true:
  824. player command "/killall monsters"
  825. set {_Scatter.Player} to a random element out of {_Solos::*}
  826. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  827. remove {_Scatter.Player} from {_Solos::*}
  828. remove 1 from {_SoloSize}
  829. add 1 to {_Scattered}
  830. add 1 to {_TotalScattered}
  831. if {_Scatter.Player} is not online:
  832. if {_Scatter.Player} is "%command sender%":
  833. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  834. if {@SEMTAp} is true:
  835. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  836. else:
  837. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  838. if {@SEMTAp} is true:
  839. send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  840. else:
  841. if {_Scatter.Player} is "%command sender%":
  842. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  843. if {@SEMTAp} is true:
  844. send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  845. else:
  846. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  847. send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
  848. if {@SEMTAp} is true:
  849. send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
  850. loop {_ScatterTicks} times:
  851. wait 1 tick
  852. if {_SoloSize} is more than {@ScaTimes}:
  853. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}{@ScaTimes}{@BC}] {@C}more solo players!"
  854. else:
  855. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}%{_SoloSize}%{@BC}] {@C}more solo players!"
  856. command "/scattersound"
  857. set {_TPSStartTime} to now
  858. loop 5 times:
  859. wait 20 ticks
  860. if {@Butcher} is true:
  861. player command "/killall monsters"
  862. set {_TPSEndTime} to now
  863. set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
  864. set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
  865. replace all " seconds" in {_parsedText} with ""
  866. set {_TPSTime} to ("%{_parsedText}%" parsed as number)
  867. set {_tps} to (100/{_TPSTime})
  868. loop all entities in the player's world:
  869. add 1 to {_entites}
  870. if {_tps} is greater than 17.5:
  871. if {@TPSR} is true:
  872. send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
  873. else if {_tps} is greater than 15:
  874. if {@TPSR} is true:
  875. send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
  876. player command "/gamerule doMobSpawning false"
  877. else if {_tps} is greater than 10:
  878. if {@TPSR} is true:
  879. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
  880. player command "/killall all"
  881. else if {_tps} is greater than 1:
  882. if {@TPSR} is true:
  883. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
  884. player command "/killall all"
  885. else:
  886. if {@TPSR} is true:
  887. send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
  888. wait 1 tick
  889. if {Scatter.Cancel} is not set:
  890. set {_Scattered.Solos} to {_Scattered}
  891. if {Teams::*} is not set:
  892. set {_Scattered.Teams} to 0
  893. broadcast ""
  894. broadcast "{@P}{@C} A total of {@BC}[{@H}%{_Scattered.Teams}%{@BC}] {@H}teams & {@BC}[{@H}%{_Scattered.Solos}%{@BC}] {@H}solos {@C}scattered! Took {@H}%difference between {_Time} and now%!"
  895. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  896. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  897. broadcast "{@P}{@C} If you are stuck in a block, use {@H}/fix! {@C}Disabling the command in {@BC}[{@H}30{@BC}] {@H}seconds!"
  898. teleport command sender to {_CMDSender}
  899. set {_TPSStartTime} to now
  900. loop 5 times:
  901. wait 20 ticks
  902. if {@Butcher} is true:
  903. player command "/killall monsters"
  904. set {_TPSEndTime} to now
  905. set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
  906. set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
  907. replace all " seconds" in {_parsedText} with ""
  908. set {_TPSTime} to ("%{_parsedText}%" parsed as number)
  909. set {_tps} to (100/{_TPSTime})
  910. loop all entities in the player's world:
  911. add 1 to {_entites}
  912. if {_tps} is greater than 17.5:
  913. if {@TPSR} is true:
  914. send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
  915. else if {_tps} is greater than 15:
  916. if {@TPSR} is true:
  917. send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
  918. player command "/gamerule doMobSpawning false"
  919. else if {_tps} is greater than 10:
  920. if {@TPSR} is true:
  921. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
  922. player command "/killall all"
  923. else if {_tps} is greater than 1:
  924. if {@TPSR} is true:
  925. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
  926. player command "/killall all"
  927. else:
  928. if {@TPSR} is true:
  929. send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
  930. send "{@P}{@C} Killing all {@H}hostile mobs {@C}for {@BC}[{@H}1{@BC}] {@H}minute!" to all ops
  931. wait 1 tick
  932. set {Scatter.Fix} to true
  933. if {@Sounds} is true:
  934. loop all players:
  935. command "/playsound note.pling %loop-player%"
  936. loop 10 times:
  937. player command "/killall monsters"
  938. wait 1 second
  939. send "{@P}{@C} &cEnabling {@C}mob spawning, still {@H}butchering!"
  940. if {@Vanish} is true:
  941. command "/invis off"
  942. broadcast "{@P}{@H} Reappearing {@C}everyone! {@H}/Fix {@C}will be &cdisabled {@C}in {@BC}[{@H}15{@BC}] {@H}seconds!"
  943. player command "/gamerule doMobSpawning true"
  944. delete {Scatter.Scattering::*}
  945. delete {Scatter.DontUnloadChunks}
  946. loop 15 times:
  947. player command "/killall monsters"
  948. wait 1 second
  949. delete {Scatter.Fix}
  950. broadcast "{@P}{@H} /Fix {@C}is now &cdisabled{@BC}, {@C}don't try to use it!"
  951. set {_TPSStartTime} to now
  952. loop 5 times:
  953. wait 20 ticks
  954. if {@Butcher} is true:
  955. player command "/killall monsters"
  956. set {_TPSEndTime} to now
  957. set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
  958. set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
  959. replace all " seconds" in {_parsedText} with ""
  960. set {_TPSTime} to ("%{_parsedText}%" parsed as number)
  961. set {_tps} to (100/{_TPSTime})
  962. if {_tps} is greater than 17.5:
  963. if {@TPSR} is true:
  964. send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
  965. else if {_tps} is greater than 15:
  966. if {@TPSR} is true:
  967. send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
  968. player command "/gamerule doMobSpawning false"
  969. else if {_tps} is greater than 10:
  970. if {@TPSR} is true:
  971. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
  972. player command "/killall all"
  973. else if {_tps} is greater than 1:
  974. if {@TPSR} is true:
  975. send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
  976. player command "/killall all"
  977. else:
  978. if {@TPSR} is true:
  979. send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
  980. delete {Scatter.DontUnloadChunks}
  981. delete {Scatter.Scattering::*}
  982. delete {Scatter.Fix}
  983. delete {Scatter.Cancel}
  984. delete {Invis::*}
  985. delete {Scatter.Scattering}
  986. command "/invis off"
  987.  
  988. #--------------------------------------------------#
  989. # Single Player Scatter #
  990. #--------------------------------------------------#
  991.  
  992. else if ("%arg-3%" parsed as offlineplayer) is online:
  993. loop {@Tries} times:
  994. if (loop-number-2) is {@Tries}:
  995. broadcast "{@P}{@C} Could not scatter {@H}%arg-3%!"
  996. send "{@P}{@C} Try lowering the {@H}mindist!"
  997. command "/scatterbroke"
  998. stop trigger
  999. set {_Location.Good} to true
  1000. set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
  1001. if {_Location.Good} is true:
  1002. set {_Location.GroundLevel} to {_Location.Sky}
  1003. while (block at {_Location.GroundLevel}) is air:
  1004. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  1005. delete {_Location.Good}
  1006. stop loop
  1007. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  1008. if {_Location.Good} is true:
  1009. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  1010. delete {_Location.Good}
  1011. else:
  1012. set {_GoodLocation.Sky} to ({_Location.Sky})
  1013. set {_GoodLocation.GroundLevel} to (location 1 above {_Location.GroundLevel})
  1014. stop loop
  1015. set {Scattering::%arg-3%} to true
  1016. teleport ("%arg-3%" parsed as offlineplayer) to ({_GoodLocation.GroundLevel})
  1017. send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}1{@BC}/{@H}1{@BC}]" to ("%arg-3%" parsed as offlineplayer) for 20, 20, 20
  1018. send "{@P} {@BC}- {@H}%arg-3%{@C} Scattered." to all ops
  1019. wait 1 second
  1020. delete {Scatter.Scattering::%arg-3%}
  1021.  
  1022. #--------------------------------------------------#
  1023. # Invisible Command #
  1024. # Thank you Cam for making this! #
  1025. #--------------------------------------------------#
  1026.  
  1027. command /invis [<text=toggle>]:
  1028. permission: {@Permission}
  1029. trigger:
  1030. if arg-1 is "on" or "enable":
  1031. set {invis} to true
  1032. loop all players:
  1033. command "/van %loop-player%"
  1034. add loop-player to {Invis::*}
  1035. else if arg-1 is "off" or "disable":
  1036. delete {invis}
  1037. loop {Invis::*}:
  1038. command "/rea %loop-value%"
  1039. remove loop-value from {Invis::*}
  1040. else if arg-1 is "toggle":
  1041. if {invis} is set:
  1042. delete {invis}
  1043. loop {Invis::*}:
  1044. command "/rea %loop-value%"
  1045. remove loop-value from {Invis::*}
  1046. else:
  1047. set {invis} to true
  1048. loop all players:
  1049. command "/van %loop-player%"
  1050. add loop-player to {Invis::*}
  1051.  
  1052. #--------------------------------------------------#
  1053. # Scatter Sound Commands #
  1054. #--------------------------------------------------#
  1055.  
  1056. command /scattersound:
  1057. permission: {@Permission}
  1058. trigger:
  1059. {@Sounds} is true
  1060. loop all players:
  1061. command "/playsound {@ScatterSound} %loop-player% ~ ~ ~ 1 0.5 1"
  1062.  
  1063. command /scatterbroke:
  1064. permission: {@Permission}
  1065. trigger:
  1066. {@Sounds} is true
  1067. loop all players:
  1068. command "/playsound random.break %loop-player%"
  1069.  
  1070. #--------------------------------------------------#
  1071. # Cancel Scatter Command #
  1072. #--------------------------------------------------#
  1073.  
  1074. #command /cancelscatter:
  1075. # permission: {@Permission}
  1076. # aliases: /cancelsca, /csca, /scattercancel
  1077. # trigger:
  1078. # if {Scatter.Scattering} is set:
  1079. # set {Scatter.Cancel} to true
  1080. # delete {Scatter.DontUnloadChunks}
  1081. # delete {Scatter.Scattering::*}
  1082. # delete {Scatter.Fix}
  1083. # delete {Invis::*}
  1084. # broadcast "{@P}{@C} The scatter has been cancelled by {@H}%command sender%!"
  1085. # command "/scatterbroke"
  1086. # command "/invis off"
  1087. # send "{@P}{@C} The scatter will stop within a few {@H}seconds!"
  1088. # send "{@P}{@C} You may want to {@H}/tpall!"
  1089. # else:
  1090. # send "{@P}{@C} There is no {@H}scatter {@C}running!"
  1091. #--------------------------------------------------#
  1092. # Miscellaneous Things #
  1093. #--------------------------------------------------#
  1094.  
  1095. on join:
  1096. {invis} is true
  1097. command "/van %event-player%"
  1098. add event-player to {Invis::*}
  1099.  
  1100. on disconnect:
  1101. {Invis::%event-player%} is set
  1102. command "/rea %event-player%"
  1103.  
  1104. on skript load:
  1105. delete {Scatter.DontUnloadChunks}
  1106. delete {Scatter.Scattering::*}
  1107. delete {Scatter.Fix}
  1108. delete {Scatter.Cancel}
  1109. delete {Scatter.Scattering}
  1110. delete {Invis::*}
  1111. broadcast "{@P}{@C} Thanks for installing {@H}Nate's scatter version {@BC}[{@H}{@Version}{@BC}]!"
  1112. broadcast "{@P}{@C} If you have any questions, tweet at {@H}@NatePlaysUHC!"
  1113. broadcast "{@P}{@C} Want to see the {@H}scatter {@C}in action, follow {@H}@OblivionUHC {@C}on {@H}twitter!"
  1114.  
  1115. on login:
  1116. delete {Scatter.Scattering::%player%}
  1117. if {SchedueldScatter::%player%} is set:
  1118. teleport (player) to ({SchedueldScatter::%player%})
  1119. delete {SchedueldScatter::%player%}
  1120. send "{@P} {@BC}- {@H}%player% {@BC}- {@C}Late Scattered!" to all ops
  1121. if {invis} is true:
  1122. command "/van %event-player%"
  1123. add event-player to {Invis::*}
  1124.  
  1125. on chunk unload:
  1126. {Scatter.DontUnloadChunks} is true
  1127. cancel the event
  1128.  
  1129. on damage of a player:
  1130. {Scatter.Scattering::%victim%} is true
  1131. cancel the event
  1132.  
  1133. command /fix:
  1134. trigger:
  1135. if {Scatter.Fix} is set:
  1136. set {_CMDLocB} to location of the command sender
  1137. teleport the command sender to (location 1 above {_CMDLocB})
  1138. send "{@P}{@C} You are now out of the {@H}block!"
  1139. else:
  1140. send "{@P}{@C} This command is {@H}disabled!"
  1141.  
  1142. # Well you made it to the bottom
  1143. # Hope you enjoyed the code.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement