BioPrince

quarry loader

Jun 25th, 2014
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. rednet.open("right")
  2. print("slot : number : item")
  3. print("1-4. 4 turtle")
  4. print("5. 4 stone")
  5. print("6. 4 dirt")
  6. print("7. 4 chest")
  7. print("8. 4 coal")
  8. print("9. enderchest")
  9. print("10. chunkloader")
  10.  
  11.  
  12. function wait()
  13. print("press any key to continue...")
  14. os.pullEvent("key")
  15. local count = 0
  16. while count<15 do
  17. count = turtle.getItemCount(5)+turtle.getItemCount(6)+turtle.getItemCount(7)+turtle.getItemCount(8)
  18. sleep(2.5)
  19. print("checking quantities")
  20. end
  21. end
  22.  
  23. function load()
  24. local i = 0
  25. local j = 0
  26. print("Starting: Please Stand Back")
  27. for i=1,4 do
  28. turtle.select(i)
  29. turtle.place()
  30. for j=5,8 do
  31. turtle.select(j)
  32. turtle.drop(1)
  33. end
  34. turtle.turnRight()
  35. end
  36. turtle.select(9)
  37. turtle.up()
  38. turtle.placeDown()
  39. turtle.select(10)
  40. turtle.placeUp()
  41. for i=1,4 do
  42. rednet.broadcast("BioPrince")
  43. sleep(1)
  44. end
  45. end
  46.  
  47. function calm()
  48. local count=0
  49. while count<4 do
  50. local id, msg = rednet.receive()
  51. if msg == "BioPrince" then
  52. count=count+1
  53. print(count," down ",4-count," to go.")
  54. end
  55.  
  56. end
  57. end
  58.  
  59. function startUnload()
  60. turtle.digUp()
  61. turtle.digDown()
  62. turtle.down()
  63. end
  64.  
  65. -- picking up the the turtle
  66. function unload()
  67. for j=1,4 do
  68. for i=1,16 do
  69. turtle.select(i)
  70. turtle.suck()
  71. end
  72. turtle.dig()
  73. turtle.turnRight()
  74. end
  75. end
  76.  
  77. wait()
  78. load()
  79. calm()
  80. startUnload()
  81. unload()
Advertisement
Add Comment
Please, Sign In to add comment