Advertisement
Fettish

Turtle Excavator Bot 20x20

Jul 28th, 2024 (edited)
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. turtle.refuel()
  2.  
  3. Height = 5
  4.  
  5. -- Length.
  6. function Dig1()
  7.     local length = 20
  8.     for i = 1, length, 1 do
  9.         turtle.dig()
  10.         turtle.forward()
  11.     end
  12. end
  13.  
  14. -- Mining loop.
  15. function Mine()
  16.     Dig1()
  17.     turtle.turnRight()
  18.     turtle.dig()
  19.     turtle.forward()
  20.     turtle.turnRight()
  21.     Dig1()
  22.     turtle.turnLeft()
  23.     turtle.dig()
  24.     turtle.forward()
  25.     turtle.turnLeft()
  26. end
  27.  
  28. -- Width.
  29. function Strip()
  30.     local width = 10
  31.     for i = 1, width, 1 do
  32.         Mine()
  33.     end
  34. end
  35.  
  36. -- Calling the turtle to the dropoff area.
  37. function Home()
  38.     local length = 20
  39.     local hdepth = 0
  40.     local inventory = 16
  41.     local x = 1
  42.     turtle.turnRight()
  43.     turtle.turnRight()
  44.     turtle.turnRight()
  45.     for i = 1, length, 1 do
  46.         turtle.forward()
  47.     end
  48.     for i = 1, inventory, 1 do
  49.         turtle.select(x)
  50.         turtle.dropDown()
  51.         x = x + 1
  52.     end
  53.     turtle.turnRight()
  54. end
  55.  
  56. -- Calling the turtle back to the mining area.
  57. function Back()
  58.     local bdepth = 1
  59.     for i = 1, bdepth, 1 do
  60.         turtle.digDown()
  61.         turtle.down()
  62.         bdepth = bdepth + 1
  63.     end
  64. end
  65.  
  66.  
  67. for i = 1, Height, 1 do
  68.     Strip()
  69.     Home()
  70.     Back()
  71. end
  72.  
  73. -- pastebin get 2L56gVFY ext
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement