Advertisement
superjaja05

Untitled

Sep 17th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. local args = {...}
  2.  
  3. i = 0
  4.  
  5. function du()
  6. turtle.digDown()
  7. end
  8. function p()
  9. turtle.place()
  10. end
  11. function pu()
  12. turtle.placeDown()
  13. end
  14. function tl()
  15. turtle.turnLeft()
  16. end
  17. function tr()
  18. turtle.turnRight()
  19. end
  20. function fw()
  21. turtle.forward()
  22. end
  23. function up()
  24. turtle.down()
  25. end
  26.  
  27. function search()
  28. print("Initalizing search for blocks")
  29. slot1 = 1
  30. done1 = false
  31. repeat
  32. print("Searching slot "..slot1)
  33. if turtle.getItemDetail(slot1) ~= nil then
  34. turtle.select(slot1)
  35. turtle.transferTo(1)
  36. turtle.select(1)
  37. break
  38. else
  39. slot1 = slot1+1
  40. end
  41. if slot1 == 16 and turtle.getItemDetail(16) == nil then
  42. os.sleep(2)
  43. textutils.slowPrint("Not found.. rebooting")
  44. os.reboot()
  45. end
  46. until done1 == true
  47. end
  48.  
  49.  
  50. turtle.place()
  51. turtle.placeDown()
  52. turtle.turnRight()
  53. turtle.forward()
  54. turtle.down()
  55. turtle.placeDown()
  56. repeat
  57. if turtle.getItemDetail() == nil then
  58. search()
  59. end
  60. tl()
  61. fw()
  62. up()
  63. pu()
  64. until turtle.inspect() == true
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement