Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Directions etc.
- #Make all strings!
- function fillDir(p: player, block: String, world: String, d: direction, x: String, y: String, z: String, xa: String, ya: String, za: String, xa2: String, ya2: String, za2: String):
- 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 firstChar({_za}) is "-":
- replace all "-" in {_za} with ""
- else:
- set {_za} to "-%{_za}%"
- #set {_f} to firstChar({_xa})
- #set {_str} to "10"
- #send "&4%firstChar({_str})%" to console
- #send "&8%{_f}%" to {_p}
- if firstChar({_xa}) is "-":
- 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.
- #send firstChar({_za2}) to {_p}
- send firstChar({_za2}) to console
- if firstChar("%{_za2}%") is "-":
- send "&6%{_za2}%" to {_p}
- replace all "-" in {_za2} with ""
- #Remove eerste karakter van {_za2} functie (remFirstChar)
- else:
- set {_za2} to "-%{_za2}%"
- if firstChar({_xa2}) is "-":
- 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
- send "&9%{_xa2}%" to console
- send "%{_ya2}%" to console
- send "%{_za2}%" to console
- send "%{_xa}%" to console
- send "%{_ya}%" to console
- send "&9%{_za}%" to console
- 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: string, n: number) :: number:
- send "&c%{_n}%" to console
- #set {_rem} to {_rem} parsed as a number
- send {_rem} to console
- if firstChar({_rem}) is "-":
- replace all "-" in {_rem} with ""
- set {_rem} to {_rem} parsed as a number
- send "&6%{_rem}%" to console
- send "&e%{_n} - {_rem}%" to console
- if {_final} is north:
- remove {_rem} from {_n}
- if {_final} is east:
- add {_rem} to {_n}
- if {_final} is south:
- add {_rem} to {_n}
- if {_final} is west:
- remove {_rem} from {_n}
- else:
- set {_rem} to {_rem} parsed as a 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}
- send "%{_n}%" to console
- return {_n}
- function firstChar(s: String) :: String:
- add {_s} to {_s::*}
- loop {_s::*}:
- set {_fc} to first character of loop-value
- if {_fc} is "-":
- return {_fc}
- else:
- return "<none>"
- #send ({_fc} parsed as a string) to console
- set {_fc} to {_fc} parsed as a String
- return {_fc}
Add Comment
Please, Sign In to add comment