Drakaxx

Farm trucs

Oct 24th, 2020 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. function dropIfFull()
  2. for i=2,16 do
  3. turtle.select(i)
  4. local itemDetail = turtle.getItemDetail()
  5. if itemDetail then
  6. turtle.dropUp()
  7. end
  8. end
  9. turtle.select(1)
  10. end
  11.  
  12. function digIfNeeded()
  13. local success, data = turtle.inspect()
  14. if success then
  15. if data.state.age == 7 then
  16. turtle.dig()
  17. turtle.select(1)
  18. turtle.place()
  19. end
  20. turtle.turnRight()
  21. else
  22. turtle.select(1)
  23. local itemDetail = turtle.getItemDetail()
  24. if itemDetail then
  25. turtle.place()
  26. else
  27. error()
  28. end
  29. end
  30. end
  31.  
  32. steps = 1
  33.  
  34. while true do
  35. dropIfFull()
  36. digIfNeeded()
  37. steps = steps + 1
  38.  
  39. if steps == 5 then
  40. os.sleep(30)
  41. steps = 1
  42. end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment