Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BaseBuilding Turtle
- -- Digs out rooms 16x16x4, with a staircase spiraling along the edges
- -- Should always be started at the top-left corner of the area to dig...
- -- No idea how I'm gonna get the stars to work, but the main part should be really easy
- local startZ = 3
- local startX = nil
- local startY = nil
- turtle.select(1)
- turtle.refuel()
- turtle.select(2)
- while(true) do
- for spacing=1,2 do
- for z=1,4 do
- if startZ then z = startZ startZ = nil end
- for x=1,16 do -- Same, always already in the first one
- if startX then x = startX startX = nil end
- for y=1,16 do -- We're always inside the first one
- if startY then y = startY startY = nil end
- turtle.dig()
- turtle.suck()
- turtle.forward()
- if not turtle.detectDown() then turtle.placeDown() end -- Make sure the floors are filled in
- end
- -- Reached the end on this side, turn (right/left)...
- if x%2 == 1 then turtle.turnRight() else turtle.turnLeft() end
- turtle.dig()
- turtle.forward()
- if x%2 == 1 then turtle.turnRight() else turtle.turnLeft() end
- -- Ready to iterate again
- end
- -- We've cleared out a 16x16 area on this level.
- -- And we are currently outside of it, pointing back in
- -- This is our staircase down
- for i=1,z do
- turtle.forward() -- Go down the staircase...
- turtle.down()
- end
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.down()
- -- Figure out how to get back to our starting point.
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- for temp=1,z do -- We will be [z] blocks from the edge on this side
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- -- And a full 15 blocks from the next edge
- for temp=1,15 do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight() -- And it's ready to iterate again
- end
- -- We have successfully dug 16x16x4
- -- And are again on our stairwell area, on the 5th block into the stairwell
- -- Continue the stairwell down to 8
- for temp=5,8 do -- This works for both halves
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.down()
- end
- -- Get back to the starting position
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- -- We are on block 8 and want to be on block 1
- for temp=8,1,-1 do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- -- And we're ready to iterate again
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment