Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fill(x: String, y: String, z: String, loc2: location, world: String, block: String):
- set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
- #set {_loc2} to location ({_x2} parsed as a number), ({_y2} parsed as a number), ({_z2} parsed as a number) of world "%{_world}%"
- if {_block} is "scematic_dirt_machine":
- loop blocks between block at {_loc1} and block at {_loc2}:
- set {block::%location of loop-block%::type} to loop-block
- send "L-b: %{block::%location of loop-block%::type}%" to console
- if loop-block is air:
- set block at location of loop-block to green glass block
- else:
- set {_block::%location of loop-block%} to loop-block
- set block at location of loop-block to red glass block
- function getDirectionalBlock(i: item, d: direction) :: item:
- set {_block::north} to 1
- set {_block::south} to 3
- set {_block::west} to 4
- set {_block::east} to 5
- return "%{_i}%:%{_block::%{_d}%}%" parsed as an item
- function getOppositeDirection(direction: direction) :: direction:
- loop split "%{_direction}%" by "and":
- if {_dir} is not set:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- else if numbersIn(loop-value) > {_dir}:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- if {_final} contains "north":
- return north
- if {_final} contains "east":
- return east
- if {_final} contains "south":
- return south
- if {_final} contains "west":
- return west
- function getOppositeDirection(direction: direction) :: direction:
- loop split "%{_direction}%" by "and":
- if {_dir} is not set:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- else if numbersIn(loop-value) > {_dir}:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- if {_final} contains "north":
- return north
- if {_final} contains "east":
- return east
- if {_final} contains "south":
- return south
- if {_final} contains "west":
- return west
- function numbersIn(s: String) :: number:
- set {_return} to ""
- loop {_s} split at "":
- set {_num} to loop-value parsed as a number
- if {_num} is set:
- "%{_num}%" = "%loop-value%"
- set {_return} to "%{_return}%%{_num}%"
- return {_return} parsed as a number
- function addNumber(x: number, y: number, z: number, w: world, dir: direction, num: number) :: location:
- if {_dir} is north:
- #send "%{_z}%"
- remove {_num} from {_z}
- if {_dir} is east:
- add {_num} to {_x}
- if {_dir} is south:
- add {_num} to {_z}
- if {_dir} is west:
- remove {_num} from {_x}
- set {_return} to location {_x}, {_y}, {_z} of world "%{_w}%"
- return {_return}
- function remove(x: String, y: String, z: String, loc2: location, world: String, block: String):
- set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
- #set {_loc2} to location ({_x2} parsed as a number), ({_y2} parsed as a number), ({_z2} parsed as a number) of world "%{_world}%"
- send "Loc1: %{_loc1}%" to console
- send "Loc2: %{_loc2}%" to console
- if {_block} is "scematic_dirt_machine":
- loop blocks between block at {_loc1} and block at {_loc2}:
- #set {block::%location of loop-block%::type} to loop-block
- send "Loop-block: %{block::%location of loop-block%::type}%" to console
- set block at location of loop-block to air
Add Comment
Please, Sign In to add comment