Advertisement
pieiscool32

Nuke Server V.2

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