Advertisement
Guest User

tunnel

a guest
Jan 17th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local function FuelCheck()
  2.     --get fuel level
  3.     --if fuel < 5
  4.         --select slot 1, refuel
  5.             --if refuel false
  6.                 --break
  7. end
  8.  
  9. local function Tunneling(distance)
  10.     for i = 1, distance do
  11.         FuelCheck()
  12.         turtle.dig()
  13.         turtle.forward()
  14.         turtle.digUp()
  15.     end
  16. end
  17.  
  18.  
  19.  
  20. local length = 0
  21.  
  22. term.write("Tunnel length: ")
  23. length = tonumber(read())
  24.  
  25.  
  26. --select slot 1, turtle.refuel()
  27.  
  28. if length>0 then
  29.   Tunneling(length)
  30. end
  31.  
  32.  
  33. --Things to do:
  34. -- if inventory is full return to chest to dump (can trying doing turtle.collect() and if it fails slots can't take new/different items)
  35. -- if fuel is getting low check to make sure we have enough to go back
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement