Advertisement
pieiscool32

Nuke Server

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