Dimencia

Untitled

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