Dimencia

Untitled

Mar 22nd, 2021
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 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 = 3
  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. for i=1,z do
  41. turtle.forward() -- Go down the staircase...
  42. turtle.down()
  43. end
  44. turtle.dig()
  45. turtle.forward()
  46. turtle.digUp()
  47. turtle.digDown()
  48. turtle.down()
  49. -- Figure out how to get back to our starting point.
  50. turtle.turnLeft()
  51. turtle.dig()
  52. turtle.forward()
  53. turtle.turnLeft()
  54. for temp=1,z do -- We will be [z] blocks from the edge on this side
  55. turtle.dig()
  56. turtle.forward()
  57. end
  58. turtle.turnRight()
  59. -- And a full 15 blocks from the next edge
  60. for temp=1,15 do
  61. turtle.dig()
  62. turtle.forward()
  63.  
  64. end
  65. turtle.turnRight() -- And it's ready to iterate again
  66. end
  67. -- We have successfully dug 16x16x4
  68. -- And are again on our stairwell area, on the 5th block into the stairwell
  69. -- Continue the stairwell down to 8
  70. for temp=5,8 do -- This works for both halves
  71. turtle.dig()
  72. turtle.forward()
  73. turtle.digUp()
  74. turtle.digDown()
  75. turtle.down()
  76. end
  77. -- Get back to the starting position
  78. turtle.turnLeft()
  79. turtle.dig()
  80. turtle.forward()
  81. turtle.turnLeft()
  82. -- We are on block 8 and want to be on block 1
  83. for temp=8,1,-1 do
  84. turtle.dig()
  85. turtle.forward()
  86. end
  87. turtle.turnRight()
  88. -- And we're ready to iterate again
  89. end
  90. end
Advertisement
Add Comment
Please, Sign In to add comment