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}:
- 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
- send "%{_block::%location of loop-block%}%" to console
- 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 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: string, y: string, z: string, w: world, dir: direction) :: location:
- if {_dir} is "north":
- remove 1 from {_z}
- if {_dir} is "east":
- add 1 to {_x}
- if {_dir} is "south":
- add 1 to {_z}
- if {_dir} is "west":
- remove 1 from {_x}
- set {_return} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_w}%"
- return {_return}
Add Comment
Please, Sign In to add comment