Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Directions etc.
- function fillDir(p: player, block: String, world: String, d: direction, x: String, y: String, z: String, xa: number, ya: number, za: number, xa2: number, ya2: number, za2: number):
- clear {scematic::block::%{_p}%::types::*}
- set {_x1} to {_x} parsed as a number
- set {_y1} to {_y} parsed as a number
- set {_z1} to {_z} parsed as a number
- if {_d} is north OR south:
- if {_za} contains "-":
- replace all "-" in {_za} with ""
- else:
- set {_za} to "-%{_za}%"
- send "%{_za2}%" to {_p}
- if {_xa} contains "-":
- replace all "-" in {_xa} with ""
- else:
- set {_xa} to "-%{_xa}%"
- send "&c%{_za2}%" to {_p}
- set {_za} to {_za} parsed as a number
- set {_xa} to {_xa} parsed as a number
- #firstChar function maken om te kijken of het eerste karakter een '-' is.
- if {_za2} contains "-":
- send "&4%{_za2}%" to {_p}
- #replace first "-" in {_za2} with ""
- #Remove eerste karakter van {_za2} functie (remFirstChar)
- else:
- set {_za2} to "-%{_za2}%"
- if {_xa2} contains "-":
- replace all "-" in {_xa2} with ""
- else:
- set {_xa2} to "-%{_xa2}%"
- set {_za2} to {_za2} parsed as a number
- set {_xa2} to {_xa2} parsed as a number
- set {_loc1} to location addDir({_d}, {_xa}, {_x1}), addDir({_d}, {_ya}, {_y1}), addDir({_d}, {_za}, {_z1}) of world "%{_world}%"
- set {_loc2} to location addDir({_d}, {_xa2}, {_x1}), addDir({_d}, {_ya2}, {_y1}), addDir({_d}, {_za2}, {_z1}) of world "%{_world}%"
- else:
- if {_za} contains "-":
- replace all "-" in {_za} with ""
- else:
- set {_za} to "-%{_za}%"
- if {_xa} contains "-":
- replace all "-" in {_xa} with ""
- else:
- set {_xa} to "-%{_xa}%"
- set {_za} to {_za} parsed as a number
- set {_xa} to {_xa} parsed as a number
- if {_za2} contains "-":
- replace all "-" in {_za2} with ""
- else:
- set {_za2} to "-%{_za2}%"
- if {_xa2} contains "-":
- replace all "-" in {_xa2} with ""
- else:
- set {_xa2} to "-%{_xa2}%"
- set {_za2} to {_za2} parsed as a number
- set {_xa2} to {_xa2} parsed as a number
- set {_loc1} to location addDir({_d}, {_za}, {_x1}), addDir({_d}, {_ya}, {_y1}), addDir({_d}, {_xa}, {_z1}) of world "%{_world}%"
- set {_loc2} to location addDir({_d}, {_za2}, {_x1}), addDir({_d}, {_ya2}, {_y1}), addDir({_d}, {_xa2}, {_z1}) of world "%{_world}%"
- loop blocks between block at {_loc1} and block at {_loc2}:
- add "%location of loop-block%$%loop-block%" to {scematic::block::%{_p}%::types::*}
- if loop-block is air:
- set block at location of loop-block to green glass block
- else:
- set block at location of loop-block to red glass block
- function addDir(final: direction, rem: number, n: number) :: number:
- if {_final} is north:
- add {_rem} to {_n}
- if {_final} is east:
- remove {_rem} from {_n}
- if {_final} is south:
- remove {_rem} from {_n}
- if {_final} is west:
- add {_rem} to {_n}
- return {_n}
Add Comment
Please, Sign In to add comment