asweigart

growclippings

Dec 18th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. os.loadAPI('hare')
  2.  
  3. print('Growing clippings...')
  4.  
  5. while true do
  6. if not hare.selectItem('cropsItem') then
  7. error('Could not find crop sticks.')
  8. end
  9. turtle.placeDown()
  10.  
  11. if not hare.selectItem('clipping') then
  12. turtle.turnRight()
  13. turtle.suck()
  14. turtle.turnLeft()
  15. -- put seeds in output chest
  16. turtle.turnLeft()
  17. while hare.selectItem('Seeds') do
  18. turtle.drop()
  19. end
  20. turtle.turnRight()
  21. end
  22.  
  23. if not hare.selectItem('clipping') then
  24. print('Done: Out of clippings.')
  25. turtle.digDown() -- get cropstick
  26. return
  27. end
  28.  
  29. -- plant clippings
  30. turtle.placeDown()
  31.  
  32. -- harvest
  33. turtle.digDown()
  34. end
Add Comment
Please, Sign In to add comment