Guest User

left

a guest
May 1st, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1. function offRs()
  2. rs.setOutput("back",false)
  3. rs.setOutput("front",false)
  4. rs.setOutput("left",false)
  5. rs.setOutput("right",false)
  6. end
  7.  
  8. function fillone()
  9. chest.pushItem("up", 1, 1, 1)
  10. chest.pushItem("up", 2, 1, 1)
  11. end
  12.  
  13. function filltwo()
  14. chest.pushItem("up", 1, 1, 2)
  15. chest.pushItem("up", 2, 1, 2)
  16. end
  17.  
  18. function fillIt()
  19. for i = 1,4 do
  20. fillone()
  21. end
  22. for i = 1,3 do
  23. filltwo()
  24. end
  25. end
  26.  
  27.  
  28. function checkIt()
  29.  
  30. if turtle.getItemCount(1) <= 4 then
  31. count = count + 1
  32. end
  33.  
  34. if turtle.getItemCount(2) <= 3 then
  35. count = count + 1
  36. end
  37. end
  38.  
  39. function goLeft()
  40. turtle.turnLeft()
  41. turtle.forward()
  42. turtle.turnRight()
  43. end
  44.  
  45. function goRight()
  46. turtle.turnRight()
  47. turtle.forward()
  48. turtle.turnLeft()
  49. end
  50.  
  51. function place1()
  52. turtle.select(1)
  53. turtle.place()
  54. end
  55.  
  56. function place2()
  57. turtle.select(2)
  58. turtle.place()
  59. end
  60.  
  61. function summon()
  62. turtle.up()
  63. turtle.up()
  64. turtle.up()
  65. turtle.up()
  66. turtle.forward()
  67. turtle.forward()
  68. place1()
  69. turtle.up()
  70. place1()
  71. goLeft()
  72. place1()
  73. goRight()
  74. goRight()
  75. place1()
  76. turtle.up()
  77. place2()
  78. goLeft()
  79. place2()
  80. goLeft()
  81. place2()
  82. goRight()
  83. turtle.down()
  84. turtle.down()
  85. turtle.turnLeft()
  86. turtle.turnLeft()
  87. turtle.forward()
  88. turtle.forward()
  89. turtle.down()
  90. turtle.down()
  91. turtle.down()
  92. turtle.down()
  93. turtle.turnRight()
  94. turtle.turnRight()
  95. end
  96.  
  97. function rsClock()
  98. rs.setOutput("left", true)
  99. sleep(5)
  100. rs.setOutput("left", false)
  101. end
  102.  
  103. chest = peripheral.wrap("bottom")
  104.  
  105. count = 0
  106.  
  107. while true do
  108. offRs()
  109. term.clear()
  110. term.setCursorPos(1,1)
  111.  
  112. if rs.getInput("front", true) then
  113.  
  114.  
  115. print("Initializing.")
  116. textutils.slowPrint("}}}}}}}}}}}}}}}}}}}}")
  117. print(" ")
  118. print("Loading Materials.")
  119. textutils.slowPrint("}}}}}}}}}}}}}}}}}}}}")
  120. do fillIt()
  121. sleep(1)
  122. print(" ")
  123. print("Checking Materials.")
  124.  
  125. do checkIt()
  126. sleep(1)
  127. textutils.slowPrint("}}}}}}}}}}}}}}}}}}}}")
  128. print(" ")
  129. end
  130.  
  131. if count == 0 then
  132. rs.setOutput("right", true)
  133. end
  134.  
  135. if rs.getInput("back", true) then
  136. print("Summoning Wither.")
  137. sleep(1)
  138. summon()
  139. sleep(180)
  140. else sleep(1)
  141. end
  142.  
  143. if count ~= 0 then
  144. print("Missing Materials.")
  145. print(" ")
  146.  
  147. rsClock()
  148. sleep(1)
  149.  
  150. end
  151. end
  152. end
  153. end
Advertisement
Add Comment
Please, Sign In to add comment