Advertisement
Fettish

Turtle Quarry Bot 50x50

Nov 17th, 2024 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. turtle.select(1)
  2. turtle.refuel()
  3. turtle.select(2)
  4. turtle.refuel()
  5. turtle.select(1)
  6.  
  7. Depth = 2
  8.  
  9. -- The function selecting the length of the quarry.
  10. function forward()
  11.     local length = 50
  12.  
  13.     for i = 1, length, 1 do
  14.         turtle.dig()
  15.         turtle.forward()
  16.     end
  17. end
  18.  
  19. -- The function calling the turtle back to the chest/unloading area.
  20. function home()
  21.     local blocks = 50
  22.     turtle.turnLeft()
  23.     for i = 1, blocks, 1 do
  24.         turtle.forward()
  25.     end
  26.     for i = 1, Depth, 1 do
  27.         turtle.up()
  28.     end
  29.     turtle.turnLeft()
  30.     turtle.forward()
  31.     local inventory = 16
  32.     local x = 1
  33.     for i = 1, inventory, 1 do
  34.         turtle.select(x)
  35.         turtle.dropDown()
  36.         x = x + 1
  37.     end
  38. end
  39.  
  40. -- The function that loops the turtle's digging.
  41. function turn()
  42.     local size = 25
  43.     for i = 1, size do
  44.         turtle.turnRight()
  45.         turtle.dig()
  46.         turtle.forward()
  47.         turtle.turnRight()
  48.         forward()
  49.         turtle.turnLeft()
  50.         turtle.dig()
  51.         turtle.forward()
  52.         turtle.turnLeft()
  53.         forward()
  54.     end
  55. end
  56.  
  57. -- The function returning the turtle to it's diggingpoint.
  58. function back()
  59.     turtle.turnLeft()
  60.     turtle.turnLeft()
  61.     turtle.forward()
  62.     for i = 1, Depth, 1 do
  63.         turtle.digDown()
  64.         turtle.down()
  65.     end
  66. end
  67.  
  68. -- The loop that keeps the program going.
  69. while(true)do
  70.     turn()
  71.     home()
  72.     Depth = Depth + 1
  73.     back()
  74. end
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement