Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- starts just above -X -Y -Z facing +X
- -- ends just above +X +Y +Z facing +X
- local facingy = false
- local function travel(dx, dy, dz)
- for k = 1, dz do turtle.up() end
- if dy ~= 0 then
- if not facingy then turtle.turnLeft() facingy=true end
- for k = 1, dy do turtle.forward() end
- for k = 1, -dy do turtle.back() end
- end
- if dx ~= 0 then
- if facingy then turtle.turnRight() facingy=false end
- for k = 1, dx do turtle.forward() end
- for k = 1, -dx do turtle.back() end
- end
- for k = 1, -dz do turtle.down() end
- end
- local function goto(x, y, z)
- local tx, ty, tz = turtle.gps()
- travel(x - tx, y - ty, z - tz)
- end
- local function make(size)
- if size == 1 then
- while not turtle.placeDown() do
- print("Out of blocks - refill and press enter!")
- read()
- end
- return
- end
- size=size/3
- local x, y, z = turtle.gps()
- local d = size - 1
- goto(x, y, z) make(size)
- goto(x+size, y, z) make(size)
- goto(x+size*2, y, z) make(size)
- goto(x+size*2, y+size, z) make(size)
- goto(x+size*2, y+size*2, z) make(size)
- goto(x+size, y+size*2, z) make(size)
- goto(x, y+size*2, z) make(size)
- goto(x, y+size, z) make(size)
- z = z + size
- goto(x, y, z) make(size)
- goto(x+size*2, y, z) make(size)
- goto(x+size*2, y+size*2, z) make(size)
- goto(x, y+size*2, z) make(size)
- z = z + size
- goto(x, y+size*2, z) make(size)
- goto(x, y+size, z) make(size)
- goto(x, y, z) make(size)
- goto(x+size, y, z) make(size)
- goto(x+size*2, y, z) make(size)
- goto(x+size*2, y+size, z) make(size)
- goto(x+size*2, y+size*2, z) make(size)
- goto(x+size, y+size*2, z) make(size)
- end
- make(81)
Advertisement
Add Comment
Please, Sign In to add comment