Godleydemon

Untitled

Jun 10th, 2013
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. local slot = 1
  2. local function refuel()
  3. local fuelLevel = turtle.getFuelLevel()
  4. if fuelLevel == "unlimited" or fuelLevel > 0 then
  5. return
  6. end
  7.  
  8. local function tryRefuel()
  9. for n=1,16 do
  10. if turtle.getItemCount(n) > 0 then
  11. turtle.select(n)
  12. if turtle.refuel(1) then
  13. turtle.select(1)
  14. return true
  15. end
  16. end
  17. end
  18. turtle.select(1)
  19. return false
  20. end
  21.  
  22. if not tryRefuel() then
  23. print( "Add more fuel to continue." )
  24. while not tryRefuel() do
  25. sleep(1)
  26. end
  27. print( "Resuming branch mine..." )
  28. end
  29. end
  30.  
  31. while true do
  32. turtle.select(slot)
  33. refuel()
  34. turtle.digDown()
  35. turtle.placeDown()
  36. turtle.forward()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment