Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t be too busy to post winners on the 8th of April, but any entries after the 7th of April at 11:59PM GMT will not be counted)
- #1 Apr 1, 2018
- Like Like x 3
- Donut
- Donut
- Addon Developer
- no addons and tested on dev32. the looping takes some time if the area selection is big so please be patient!
- Code (Skript):
- #Set point 1 command
- command /setpoint1:
- trigger:
- set {point1} to player's location
- send "&aPoint 1 has been set to your location."
- #Set point 2 command
- command /setpoint2:
- trigger:
- set {point2} to player's location
- send "&aPoint 2 has been set to your location."
- #Main command
- command /loopblocks:
- trigger:
- #Make sure everything is good to go before looping
- if {point1} is not set:
- send "&cPoint 1 has not been set."
- else if {point2} is not set:
- send "&cPoint 2 has not been set."
- else if {point1}'s world is not {point2}'s world:
- send "&cBoth points must be in the same world."
- else:
- send "&aLooping blocks... this will take a few moments, please be patient."
- #Get min/max coords
- if x-coord of {point1} is greater than x-coord of {point2}:
- set {_minX} to x-coord of {point2}
- set {_maxX} to x-coord of {point1}
- else:
- set {_minX} to x-coord of {point1}
- set {_maxX} to x-coord of {point2}
- if y-coord of {point1} is greater than y-coord of {point2}:
- set {_minY} to y-coord of {point2}
- set {_maxY} to y-coord of {point1}
- else:
- set {_minY} to y-coord of {point1}
- set {_maxY} to y-coord of {point2}
- if z-coord of {point1} is greater than z-coord of {point2}:
- set {_minZ} to z-coord of {point2}
- set {_maxZ} to z-coord of {point1}
- else:
- set {_minZ} to z-coord of {point1}
- set {_maxZ} to z-coord of {point2}
- #Loop the blocks
- set {_looping} to true
- set {_loopX} to {_minX}
- set {_loopY} to {_minY}
- set {_loopZ} to {_minZ}
- while {_looping} is true:
- add block at location at {_loopX}, {_loopY}, {_loopZ} to {_blocks::*}
- add 1 to {_loopX}
- if {_loopX} is greater than {_maxX}:
- set {_loopX} to {_minX}
- add 1 to {_loopY}
- if {_loopY} is greater than {_maxY}:
- set {_loopY} to {_minY}
- add 1 to {_loopZ}
- if {_loopZ} is greater than {_maxZ}:
- set {_looping} to false
- wait 1 tick
- #Get a string containing all the block counts
- loop {_blocks::*}:
- set {_blockType} to "%loop-value%"
- add 1 to {_blockCount::%{_blockType}%}
- set {_allBlockCounts} to ""
- loop {_blockCount::*}:
- set {_allBlockCounts} to "%{_allBlockCounts}%%{_blockCount::%loop-index%}% %loop-index% | "
- set {_allBlockCounts} to the first (length of {_allBlockCounts} - 2) characters of {_allBlockCounts}
- #Send results
- send "&aFinished!"
- send "&6Total number of blocks: &e%size of {_blocks::*}%"
- send "&6Block makeup: &e%{_allBlockCounts}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement