Advertisement
superjaja05

Untitled

Sep 15th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local args = {...}
  2.  
  3. function search()
  4. print("Initalizing search for blocks")
  5. slot1 = 1
  6. done1 = false
  7. repeat
  8. print("Searching slot "..slot1)
  9. if turtle.getItemDetail(slot1) ~= nil then
  10. turtle.select(slot1)
  11. turtle.transferTo(1)
  12. turtle.select(1)
  13. break
  14. else
  15. slot1 = slot1+1
  16. end
  17. if slot1 == 16 and turtle.getItemDetail(16) == nil then
  18. os.sleep(2)
  19. textutils.slowPrint("Not found.. rebooting")
  20. os.reboot()
  21. end
  22. until done1 == true
  23. end
  24.  
  25. i = 0
  26.  
  27. repeat
  28. if turtle.getItemDetail == nil then
  29. search()
  30. end
  31. turtle.placeDown()
  32. turtle.forward()
  33. i = i+1
  34. until i == tonumber(args[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement