Dimencia

Untitled

Mar 22nd, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. -- BaseBuilding Turtle
  2.  
  3. -- Digs out rooms 16x16x4, with a staircase spiraling along the edges
  4. -- Should always be started at the top-left corner of the area to dig...
  5.  
  6. -- No idea how I'm gonna get the stars to work, but the main part should be really easy
  7.  
  8. turtle.select(1)
  9. turtle.refuel()
  10. turtle.select(2)
  11.  
  12. while(true) do
  13. for spacing=1,2 do
  14. for z=1,4 do
  15. for x=1,15 do -- Same, always already in the first one
  16. for y=1,15 do -- We're always inside the first one
  17. turtle.dig()
  18. turtle.suck()
  19. turtle.forward()
  20. if not turtle.detectDown() then turtle.placeDown() end -- Make sure the floors are filled in
  21. end
  22. -- Reached the end on this side, turn (right/left)...
  23. if x%2 == 1 then turtle.turnRight() else turtle.turnLeft() end
  24. turtle.dig()
  25. if x%2 == 1 then turtle.turnRight() else turtle.turnLeft() end
  26. -- Ready to iterate again
  27. end
  28. -- We've cleared out a 16x16 area on this level.
  29. -- And we are currently outside of it, pointing back in
  30. -- This is our staircase down
  31. turtle.dig()
  32. turtle.digUp()
  33. turtle.digDown()
  34. turtle.forward()
  35. turtle.down()
  36. -- Figure out how to get back to our starting point.
  37. turtle.turnLeft()
  38. turtle.dig()
  39. turtle.forward()
  40. turtle.turnLeft()
  41. for temp=1,z do -- We will be [z] blocks from the edge on this side
  42. turtle.dig()
  43. turtle.forward()
  44. end
  45. turtle.turnRight()
  46. -- And a full 15 blocks from the next edge
  47. for temp=1,15 do
  48. turtle.dig()
  49. turtle.forward()
  50.  
  51. end
  52. turtle.turnRight() -- And it's ready to iterate again
  53. end
  54. -- We have successfully dug 16x16x4
  55. -- And are again on our stairwell area, on the 5th block into the stairwell
  56. -- Continue the stairwell down to 8
  57. for temp=5,8 do -- This works for both halves
  58. turtle.dig()
  59. turtle.digUp()
  60. turtle.digDown()
  61. turtle.forward()
  62. turtle.down()
  63. end
  64. -- Get back to the starting position
  65. turtle.turnLeft()
  66. turtle.dig()
  67. turtle.forward()
  68. turtle.turnLeft()
  69. -- We are on block 8 and want to be on block 1
  70. for temp=8,1,-1 do
  71. turtle.dig()
  72. turtle.forward()
  73. end
  74. turtle.turnRight()
  75. -- And we're ready to iterate again
  76. end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment