Advertisement
Guest User

Untitled

a guest
Jan 13th, 2013
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("back")
  2. rs.setOutput("bottom", true)
  3.  
  4. while true do
  5. local Id, msg, distance = rednet.receive()
  6.  
  7. if msg == "service" then
  8. while y ~= 89 do
  9. local x, y, z = gps.locate(.2)
  10. while y == nill do
  11. local x, y, z = gps.locate(.2)
  12. end
  13. if y == 89 then
  14. os.reboot()
  15. end
  16. if y > 89 then
  17. rs.setOutput("left", true)
  18. os.sleep(0.1)
  19. rs.setOutput("left", false)
  20. os.sleep(0.1)
  21. end
  22. local x, y, z = gps.locate(.2)
  23. while y == nill do
  24. local x, y, z = gps.locate(.2)
  25. end
  26. if y == 89 then
  27. os.reboot()
  28. end
  29. if y < 89 then
  30. rs.setOutput("right", true)
  31. os.sleep(0.1)
  32. rs.setOutput("right", false)
  33. os.sleep(0.1)
  34. end
  35. local x, y, z = gps.locate(.2)
  36. while y == nill do
  37. local x, y, z = gps.locate(.2)
  38. end
  39. if y == 89 then
  40. os.reboot()
  41. end
  42. end
  43. local x, y, z = gps.locate(.2)
  44. while y == nill do
  45. local x, y, z = gps.locate(.2)
  46. end
  47. if y == 89 then
  48. os.reboot()
  49. end
  50. end
  51.  
  52. if msg == "BL 1" then
  53. while y ~= 99 do
  54. local x, y, z = gps.locate(.2)
  55. while y == nill do
  56. local x, y, z = gps.locate(.2)
  57. end
  58. if y == 99 then
  59. os.reboot()
  60. end
  61. if y > 99 then
  62. rs.setOutput("left", true)
  63. os.sleep(0.1)
  64. rs.setOutput("left", false)
  65. os.sleep(0.1)
  66. end
  67. local x, y, z = gps.locate(.2)
  68. while y == nill do
  69. local x, y, z = gps.locate(.2)
  70. end
  71. if y == 99 then
  72. os.reboot()
  73. end
  74. if y < 99 then
  75. rs.setOutput("right", true)
  76. os.sleep(0.1)
  77. rs.setOutput("right", false)
  78. os.sleep(0.1)
  79. end
  80. local x, y, z = gps.locate(.2)
  81. while y == nill do
  82. local x, y, z = gps.locate(.2)
  83. end
  84. if y == 99 then
  85. os.reboot()
  86. end
  87. end
  88. local x, y, z = gps.locate(.2)
  89. while y == nill do
  90. local x, y, z = gps.locate(.2)
  91. end
  92. if y == 99 then
  93. os.reboot()
  94. end
  95. end
  96.  
  97. if msg == "floor 1" then
  98. while y ~= 107 do
  99. local x, y, z = gps.locate(.2)
  100. while y == nill do
  101. local x, y, z = gps.locate(.2)
  102. end
  103. if y == 107 then
  104. os.reboot()
  105. end
  106. if y > 107 then
  107. rs.setOutput("left", true)
  108. os.sleep(0.1)
  109. rs.setOutput("left", false)
  110. os.sleep(0.1)
  111. end
  112. local x, y, z = gps.locate(.2)
  113. while y == nill do
  114. local x, y, z = gps.locate(.2)
  115. end
  116. if y == 107 then
  117. os.reboot()
  118. end
  119. if y < 107 then
  120. rs.setOutput("right", true)
  121. os.sleep(0.1)
  122. rs.setOutput("right", false)
  123. os.sleep(0.1)
  124. end
  125. local x, y, z = gps.locate(.2)
  126. while y == nill do
  127. local x, y, z = gps.locate(.2)
  128. end
  129. if y == 107 then
  130. os.reboot()
  131. end
  132. end
  133. local x, y, z = gps.locate(.2)
  134. while y == nill do
  135. local x, y, z = gps.locate(.2)
  136. end
  137. if y == 107 then
  138. os.reboot()
  139. end
  140. end
  141.  
  142. if msg == "mage tower" then
  143. while y ~= 111 do
  144. local x, y, z = gps.locate(.2)
  145. while y == nill do
  146. local x, y, z = gps.locate(.2)
  147. end
  148. if y == 111 then
  149. os.reboot()
  150. end
  151. if y > 111 then
  152. rs.setOutput("left", true)
  153. os.sleep(0.1)
  154. rs.setOutput("left", false)
  155. os.sleep(0.1)
  156. end
  157. local x, y, z = gps.locate(.2)
  158. while y == nill do
  159. local x, y, z = gps.locate(.2)
  160. end
  161. if y == 111 then
  162. os.reboot()
  163. end
  164. if y < 111 then
  165. rs.setOutput("right", true)
  166. os.sleep(0.1)
  167. rs.setOutput("right", false)
  168. os.sleep(0.1)
  169. end
  170. local x, y, z = gps.locate(.2)
  171. while y == nill do
  172. local x, y, z = gps.locate(.2)
  173. end
  174. if y == 111 then
  175. os.reboot()
  176. end
  177. end
  178. local x, y, z = gps.locate(.2)
  179. while y == nill do
  180. local x, y, z = gps.locate(.2)
  181. end
  182. if y == 111 then
  183. os.reboot()
  184. end
  185. end
  186.  
  187. if msg == "storage 1" then
  188. while y ~= 114 do
  189. local x, y, z = gps.locate(.2)
  190. while y == nill do
  191. local x, y, z = gps.locate(.2)
  192. end
  193. if y == 114 then
  194. os.reboot()
  195. end
  196. if y > 114 then
  197. rs.setOutput("left", true)
  198. os.sleep(0.1)
  199. rs.setOutput("left", false)
  200. os.sleep(0.1)
  201. end
  202. local x, y, z = gps.locate(.2)
  203. while y == nill do
  204. local x, y, z = gps.locate(.2)
  205. end
  206. if y == 114 then
  207. os.reboot()
  208. end
  209. if y < 114 then
  210. rs.setOutput("right", true)
  211. os.sleep(0.1)
  212. rs.setOutput("right", false)
  213. os.sleep(0.1)
  214. end
  215. while y == nill do
  216. local x, y, z = gps.locate(.2)
  217. end
  218. if y == 114 then
  219. os.reboot()
  220. end
  221. end
  222. while y == nill do
  223. local x, y, z = gps.locate(.2)
  224. end
  225. if y == 114 then
  226. os.reboot()
  227. end
  228. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement