Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. --- Selects any item in inventory
  2. --- Returns true if an item is selected, false otherwise
  3. function trySelectItemAnyFirst()
  4. for i = 1, 16 do
  5. if turtle.select(i) then
  6. return true;
  7. end
  8. end
  9. return false;
  10. end
  11.  
  12. --- Place any item below
  13. --- Returns true if successfully places and item below
  14. --- False otherwise
  15. function tryPlaceAnyDown()
  16. local b = trySelectItemAnyFirst()
  17. if not b then
  18. return false
  19. end
  20. return turtle.placeDown()
  21. end
  22.  
  23. os.loadAPI("move")
  24. move.lineMotionDoWhile(3, tryPlaceAnyDown)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement