Advertisement
atm959

Mining Turtle Code

May 18th, 2019
764
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. --ComputerCraft Mining Turtle program
  2. --By atm959
  3.  
  4. --Mines straight from the "deployment point" and throws away cobblestone, gravel, and dirt along the way
  5. --Automatically refuels itself with coal it finds
  6.  
  7. --It checks the last 4 slots every time it mines a block(it reduces them all down to one, by means of dropping items and refueling)
  8.  
  9. --HOW TO USE(The slots start at 1)
  10. --Place the turtle in a suitable place and refuel it
  11. --Place one cobblestone in slot 16
  12. --Place one coal in slot 15
  13. --Place one gravel in slot 14
  14. --Place one dirt in slot 13
  15. --Run this program
  16.  
  17. while true do
  18.     turtle.dig()
  19.     turtle.forward()
  20.     turtle.suck()
  21.    
  22.     turtle.select(16)
  23.     if turtle.getItemCount() > 1 then
  24.         turtle.drop(turtle.getItemCount() - 1)
  25.     end
  26.     turtle.select(15)
  27.     if turtle.getItemCount() > 1 then
  28.         turtle.refuel(turtle.getItemCount() - 1)
  29.     end
  30.     turtle.select(14)
  31.     if turtle.getItemCount() > 1 then
  32.         turtle.drop(turtle.getItemCount() - 1)
  33.     end
  34.     turtle.select(13)
  35.     if turtle.getItemCount() > 1 then
  36.         turtle.drop(turtle.getItemCount() - 1)
  37.     end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement