Advertisement
pieiscool32

reactor code

Mar 6th, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.88 KB | None | 0 0
  1. local online = "1"
  2. local offline = "2"
  3. local water = "3"
  4. local wateroff = "4"
  5. local allstop = "5"
  6. local autorun = "6"
  7. local lights = "7"
  8. local status = "8"
  9. local shutdownKey = "poweroff"
  10. local gohome = "quit"
  11. local password = "**********"
  12. local password2 = "passowrd"
  13. term.clear()
  14. term.setCursorPos(1,1)
  15. redstone.setOutput("top",true)
  16. term.write("connecting to remote host")
  17. while true do
  18. c = colors.combine(c,colors.green)
  19. rs.setBundledOutput("back",c)
  20. sleep(0.1)
  21. c = colors.subtract(c,colors.green)
  22. rs.setBundledOutput("back",c)
  23. sleep(0.5)
  24. if c = rs.getBundledInput("back")
  25. green = colors.test(c,colors.green)
  26. print("Connection Established")
  27. else print("Connection Failed, Retrying")
  28. break
  29. end
  30. sleep(2)
  31. term.clear()
  32. term.setCursorPos(1,1)
  33. print("Geting Information From Remote Client")
  34. sleep(2)
  35. if c = rs.getBundledInput("back")
  36. green = colors.test(c,colors.green) then
  37. print("Reactor is Online")
  38. else print("Reactor is Offline")
  39. end
  40. sleep(4)
  41. while true do
  42. term.clear()
  43. term.setCursorPos(1,1)
  44. print("Please Verify Your Credentials")
  45. local enteredKey = io.read
  46. if enteredKey == password then
  47. term.clear()
  48. term.setCursorPos(1,1)
  49. print("Welcome Pieiscool32")
  50. elseif enteredKey == password2 then
  51. print("Sorry Guest, You Do Not Have Permission")
  52. sleep(2)
  53. shell.run "servermissioncontrol"
  54. else print("Credentials Did Not Match, Please Try Again")
  55. break
  56. end
  57. while true do
  58. term.clear()
  59. term.setCursorPos(1,1)
  60. print("Welcome To The Remote Reactor Control Unit")
  61. print("Please Select The Option That Corresponds To You")
  62. print("Start Reactor = 1")
  63. print("Stop Reactor = 2")
  64. print("Start Water = 3")
  65. print("Stop Water = 4")
  66. print("All Stop = 5")
  67. print("Auto Run/Stop = 6")
  68. prunt("Lights On/Off = 7")
  69. print("Check All Reactor Statuses = 8")
  70. print("Back To Mission Control = quit")
  71. sleep(2)
  72. local enteredKey = io.read
  73. if enteredKey == online then
  74. while true do
  75. print("Connecting To Reactor")
  76. c = colors.combine(c,colors.green)
  77. rs.setBundledOutput("back",c)
  78. sleep(0.2)
  79. c = colors.subtract(c,colors.green)
  80. rs.setBundledOutput("back",c)
  81. sleep(0.5)
  82. if c = rs.getBundledInput("back")
  83. green = colors.test(c,colors.green) then
  84. print("Viper Connection Established")
  85. else print("Viper Connection Non Existent, Retrying")
  86. break
  87. end
  88. sleep(0.5)
  89. print("Reactor Ignition Trigger Has Been Sent")
  90. sleep(2)
  91. shell.run "Nuke"
  92. elseif enteredKey == offline then
  93. while true do
  94. print("Connecting To Reactor")
  95. c = colors.combine(c,colors.red)
  96. rs.setBundledOutput("back",c)
  97. sleep(0.3)
  98. c = colors.subtract(c,colors.red)
  99. rs.setBundledOutput("back",c)
  100. sleep(0.5)
  101. if c = rs.getBundledInput("back")
  102. green = colors.test(c,colors.red) then
  103. print("Viper Connection Established")
  104. else print("Viper Connection Non Existent, Retrying")
  105. break
  106. end
  107. sleep(0.5)
  108. print("Reactor Shutdown Trigger Has Been Sent")
  109. sleep(2)
  110. shell.run "Nuke"
  111. elseif enteredKey == water then
  112. while true do
  113. print("Connecting To Reactor")
  114. c = colors.combine(c,colors.green) --FIX WITH CONFIG COLORS!
  115. rs.setBundledOutput("back",c)
  116. sleep(0.4)
  117. c = colors.subtract(c,colors.green)
  118. rs.setBundledOutput("back",c)
  119. sleep(0.5)
  120. if c = rs.getBundledInput("back")
  121. green = colors.test(c,colors.green) then
  122. print("Viper Connection Established")
  123. else print("Viper Connection Non Existent, Retrying")
  124. break
  125. end
  126. sleep(0.5)
  127. print("Reactor Water Ignition Trigger Has Been Sent")
  128. sleep(2)
  129. shell.run "Nuke"
  130. elseif enteredKey == wateroff then
  131. while true do
  132. print("Connecting To Reactor")
  133. c = colors.combine(c,colors.green) --FIX WITH CONFIG COLORS!
  134. rs.setBundledOutput("back",c)
  135. sleep(0.5)
  136. c = colors.subtract(c,colors.green)
  137. rs.setBundledOutput("back",c)
  138. sleep(0.5)
  139. if c = rs.getBundledInput("back")
  140. green = colors.test(c,colors.green) then
  141. print("Viper Connection Established")
  142. else print("Viper Connection Non Existent, Retrying")
  143. break
  144. end
  145. sleep(0.5)
  146. print("Water Shutdown Trigger Has Been Sent")
  147. sleep(2)
  148. shell.run "Nuke"
  149. elseif enteredKey == allstop then
  150. while true do
  151. print("Connecting To Reactor")
  152. c = colors.combine(c,colors.green) --FIX WITH CONFIG COLORS!
  153. rs.setBundledOutput("back",c)
  154. sleep(0.6)
  155. c = colors.subtract(c,colors.green)
  156. rs.setBundledOutput("back",c)
  157. sleep(0.5)
  158. if c = rs.getBundledInput("back")
  159. green = colors.test(c,colors.green) then
  160. print("Viper Connection Established")
  161. else print("Viper Connection Non Existent, Retrying")
  162. break
  163. end
  164. sleep(0.5)
  165. print("Full System Shutdown Trigger Has Been Sent")
  166. sleep(2)
  167. shell.run "Nuke"
  168. elseif enteredKey == status then
  169. print("Loading GUI")
  170. sleep(2)
  171. term.clear()
  172. term.setCursorPos(1,1)
  173. shell.run "statusNuke"
  174. elseif enteredKey == shutdownKey then
  175. term.write("Server Going Offline")
  176. redstone.setOutput("top",false")
  177. for i=1,3 do
  178. sleep(0.5)
  179. term.write(".")
  180. sleep(2)
  181. os.shutdown()
  182. elseif enteredKey == gohome then
  183. Print("Loading GUI")
  184. sleep(2)
  185. shell.run "servermissioncontrol"
  186. else print("Option Not Valid, Try Again")
  187. sleep(2)
  188. break
  189. end
  190. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement