Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. --
  2. -- Created by IntelliJ IDEA.
  3. -- User: jonas
  4. -- Date: 24.03.2019
  5. -- Time: 16:53
  6. -- To change this template use File | Settings | File Templates.
  7. --
  8. function harvest()
  9. turtle.dig()
  10. turtle.forward()
  11. local x=0
  12. while turtle.compareUp() do
  13. turtle.digUp()
  14. turtle.up()
  15. x = x +1
  16. end
  17.  
  18. for i=0, x, 1 do
  19. turtle.down()
  20. end
  21.  
  22. turtle.back()
  23.  
  24. return
  25. end
  26.  
  27. while true do
  28. if turtle.detect() then
  29. if turtle.compare() then
  30. harvest()
  31. end
  32. else
  33. turtle.select(2)
  34. turtle.place()
  35. turtle.select(1)
  36. end
  37.  
  38. turtle.turnLeft()
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement