Advertisement
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):
- set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
- clear {scematic::block::%{_p}%::types::*}
- #addDir({_d}, {_xa} parsed as a number, {_ya} parsed as a number, {_za} parsed as a number, {_loc2})
- set {_loc2} to addDir(east, 10, 10)
- send "Loc1: %{_loc1}%" to console
- send "Loc2: %{_loc2}%" to console
- 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 fillDir(x: String, y: String, z: String, loc2: location, world: String, block: String, p: player):
- #set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
- #if {_block} is "scematic_dirt_machine":
- # clear {scematic::block::%{_p}%::types::*}
- # 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 addDirs(world: String, final: direction, rem: number, yrem: number, l: location) :: number:
- send "&6%{_l}%" to console
- loop split "%{_l}%" by ",":
- if loop-value contains "x:":
- set {_x} to loop-value
- replace "x: " in {_x} with ""
- if loop-value contains "y:":
- set {_y} to loop-value
- replace " y: " in {_y} with ""
- if loop-value contains "z:":
- set {_z} to loop-value
- replace " z: " in {_z} with ""
- set {_z} to ({_z} parsed as a number)
- set {_x} to ({_x} parsed as a number)
- set {_z} to ({_z} parsed as a number)
- if {_final} is north:
- send "Before: %{_z}%" to console
- send "%{_rem}%" to console
- add {_rem} to {_z}
- send "After: %{_z}%" to console
- if {_final} is east:
- send "Before: %{_x}%" to console
- send "%{_rem}%" to console
- add {_rem} to {_x}
- send "After: %{_x}%" to console
- if {_final} is south:
- send "Before: %{_z}%" to console
- send "%{_rem}%" to console
- add {_rem} to {_z}
- send "After: %{_z}%" to console
- if {_final} is west:
- send "Before: %{_x}%" to console
- send "%{_rem}%" to console
- remove {_rem} from {_x}
- send "After: %{_x}%" to console
- add {_yrem} to {_y}
- set {_x} to "x: %{_x}%"
- set {_y} to "y: %{_y}%"
- set {_z} to "z: %{_z}%"
- set {_loc} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
- send "%{_x}%, %{_y}%, %{_z}%, %{_world}%" to console
- send "&5%{_loc}%" to console
- return {_loc}
- function addDir(final: direction, rem: number, n: number) :: number:
- send "Before: %{_n}%" to console
- if {_final} is north:
- add {_rem} to {_n}
- if {_final} is east:
- add {_rem} to {_n}
- if {_final} is south:
- remove {_rem} from {_n}
- if {_final} is west:
- remove {_rem} from {_n}
- send "After: %{_n}%" to console
- return {_n}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement