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}%"
- if firstChar({_xa}) is "-":
- replace all "-" in {_xa} with ""
- else:
- set {_xa} to "-%{_xa}%"
- if firstChar("%{_za2}%") is "-":
- send "&6%{_za2}%" to {_p}
- replace all "-" in {_za2} with ""
- else:
- set {_za2} to "-%{_za2}%"
- if firstChar({_xa2}) is "-":
- replace all "-" in {_xa2} with ""
- else:
- set {_xa2} to "-%{_xa2}%"
- 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 firstChar({_za}) is "-":
- replace all "-" in {_za} with ""
- else:
- set {_za} to "-%{_za}%"
- if firstChar({_xa}) is "-":
- 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 firstChar({_za2}) is "-":
- replace all "-" in {_za2} with ""
- else:
- set {_za2} to "-%{_za2}%"
- if firstChar({_xa2}) is "-":
- replace all "-" in {_xa2} with ""
- else:
- set {_xa2} to "-%{_xa2}%"
- 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:
- if firstChar({_rem}) is "-":
- replace all "-" in {_rem} with ""
- set {_rem} to {_rem} parsed as a number
- 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}
- 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