Advertisement
Schleimpilz

Untitled

May 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. local function returnSupplies()
  2. local x,y,z,xd,zd = xPos,depth,zPos,xDir,zDir
  3. print( "Returning to surface..." )
  4. goTo( 0,0,0,0,-1 )
  5.  
  6. local fuelNeeded = 2*(x+y+z) + 1
  7. if not refuel( fuelNeeded ) then
  8. unload( true )
  9. print( "Waiting for fuel" )
  10. while not refuel( fuelNeeded ) do
  11. os.pullEvent( "turtle_inventory" )
  12. end
  13. else
  14. unload( true )
  15. end
  16.  
  17. print( "Resuming mining..." )
  18. goTo( x,y,z,xd,zd )
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement