Advertisement
Jd1177

tankfill

Jun 13th, 2021
1,074
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. i=0
  2. x=0
  3. b=0
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. term.write("Distance: ")
  7. x=tonumber(read())
  8.  
  9. if turtle.getItemCount(1) < 1 then
  10.   print("No Buckets in Slot 1")
  11.   exit()
  12. end
  13.  
  14. z=2
  15. turtle.select(1)
  16. while x > i and z>=2  do
  17.   z=turtle.getItemCount(1)
  18.     while turtle.forward()==false do
  19.       while turtle.detect() do
  20.         turtle.dig()
  21.         turtle.sleep(.5)
  22.       end
  23.     end
  24.     i=i+1
  25.     if turtle.placeDown()==false then
  26.       z=2
  27.     else
  28.       b=b+1
  29.     end
  30. end
  31.   for a=1,i do
  32.     turtle.back()
  33.   end
  34.    
  35.   print("Moved "..i.." Blocks")
  36.   print("Collected "..b.." buckets")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement