Advertisement
minuslinus

1x1 dig down

Apr 25th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. y=0
  2.  
  3.  
  4. function checkFuel()
  5.     if turtle.getFuelLevel() < 100 then
  6.         turtle.select(1)
  7.         turtle.refuel(1)
  8.     end
  9. end
  10.  
  11. function up()
  12.     for i=1, y do
  13.         turtle.up()
  14.     end
  15. end
  16.  
  17. function dig()
  18.     if turtle.down() == true then
  19.         checkFuel()
  20.         turtle.digDown()
  21.         y=y+1
  22.     else
  23.         up()
  24.         os.exit()
  25.     end
  26. end
  27.  
  28.  
  29.  
  30.  
  31. checkFuel()
  32. turtle.digDown()
  33.  
  34. while true do
  35.     dig()
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement