Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. function isfull()
  2.     for i=1,16,1 do
  3.         if turtle.getItemSpace(i) > 0 then
  4.             return false
  5.         end
  6.     end
  7.     return true
  8. end
  9.  
  10. function dig_three_blocs(upordown)
  11.     if turtle.detect() == true then
  12.         turtle.dig()
  13.     end
  14.     for i=1,2,1 do
  15.         if upordown == false then
  16.             turtle.up()
  17.         end
  18.         if upordown == true then
  19.             turtle.down()
  20.         end
  21.         if turtle.detect() == true then
  22.             turtle.dig()
  23.         end
  24.     end
  25. end
  26.        
  27.  
  28. function main()
  29.     local upordown = false
  30.     while isfull() == false do
  31.         if turtle.getFuelLevel() < 3 then
  32.             turtle.select(2)
  33.             turtle.refuel(1)
  34.             turtle.select(1)
  35.         end
  36.         dig_three_blocs(upordown)
  37.         turtle.forward()
  38.         upordown = not upordown
  39.     end
  40. end
  41.  
  42. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement