Xixili

Purge system (startup 1/3)

Aug 29th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.70 KB | None | 0 0
  1. -- ######################
  2. -- ##call this file "startup"
  3. -- ######################
  4.  
  5. os.pullEvent = os.pullEventRaw
  6. local standby = 5
  7. local side = "left"
  8. local password = "603526"
  9. local agree = ""
  10. local YES = "y"
  11. local back = "back"
  12. local A = "A"
  13. local B = "B"
  14. local C = "C"
  15.  
  16. -- ######################
  17. -- ##Term Settings
  18. -- ######################
  19.  
  20. local width, height = term.getSize()
  21.  
  22. term.setCursorPos(1, 1)
  23. term.setBackgroundColor(colors.gray)
  24. term.clear()
  25.  
  26. term.setTextColor(colors.white)
  27. term.setBackgroundColor(colors.red)
  28. term.clearLine()
  29.  
  30. term.setCursorPos(1, height)
  31. term.clearLine()
  32.  
  33. local text = "E.D.SYS"
  34. term.setCursorPos(math.floor((width - #text) / 2), 1)
  35. term.write(text)
  36.  
  37. -- ######################
  38. -- #### STAGE 1 LOGIN
  39. -- ######################
  40.  
  41. term.setTextColor(colors.red)
  42. term.setBackgroundColor(colors.black)
  43. term.setCursorPos(5, 3)
  44. term.write(" DANGER ")
  45. term.setTextColor(colors.red)
  46. term.setBackgroundColor(colors.black)
  47. term.setCursorPos(5, 4)
  48. term.write(" EMERGENCY DESTRUCTION SYSTEM ")
  49. term.setTextColor(colors.yellow)
  50. term.setBackgroundColor(colors.black)
  51. term.setCursorPos(5, 5)
  52. term.write(" ON ACTIVATION IT WILL DETONATE IN ")
  53. term.setTextColor(colors.yellow)
  54. term.setBackgroundColor(colors.black)
  55. term.setCursorPos(5, 6)
  56. term.write(" T MINUS MINUTES ")
  57. term.setTextColor(colors.red)
  58. term.setBackgroundColor(colors.black)
  59. term.setCursorPos(25, 6)
  60. term.write("10")
  61.  
  62. term.setTextColor(colors.red)
  63. term.setBackgroundColor(colors.black)
  64. term.setCursorPos(5, 8)
  65. term.write(" FAILSAFE WARNING ")
  66. term.setTextColor(colors.yellow)
  67. term.setBackgroundColor(colors.black)
  68. term.setCursorPos(5, 9)
  69. term.write(" CUT-OFF SYSTEM WILL NOT OPERATE AFTER ")
  70. term.setTextColor(colors.yellow)
  71. term.setBackgroundColor(colors.black)
  72. term.setCursorPos(5, 10)
  73. term.write(" T MINUS MINUTES ")
  74. term.setTextColor(colors.red)
  75. term.setBackgroundColor(colors.black)
  76. term.setCursorPos(25, 10)
  77. term.write("5")
  78.  
  79. term.setCursorPos(13, 16)
  80. term.setBackgroundColor(colors.black)
  81. term.write(" ")
  82.  
  83. term.setTextColor(colors.white)
  84. term.setBackgroundColor(colors.gray)
  85. term.setCursorPos(13, 15)
  86. term.write("Security Code:")
  87. local input = read("")
  88.  
  89. term.setCursorPos(13, 16)
  90. if input == password then
  91. term.setCursorPos(13, 16)
  92. term.setBackgroundColor(colors.black)
  93. term.setTextColor(colors.lime)
  94. term.write(" Security Code accepted ")
  95. sleep(2)
  96.  
  97. -- ######################
  98. -- #### LOADING SCREEN
  99. -- ######################
  100.  
  101. term.setCursorPos(1, 1)
  102. term.setBackgroundColor(colors.gray)
  103. term.clear()
  104.  
  105. term.setTextColor(colors.white)
  106. term.setBackgroundColor(colors.red)
  107. term.clearLine()
  108.  
  109. term.setCursorPos(1, height)
  110. term.clearLine()
  111.  
  112. local text = "E.D.SYS"
  113. term.setCursorPos(math.floor((width - #text) / 2), 1)
  114. term.write(text)
  115.  
  116. -- ##
  117.  
  118. term.setCursorPos(3, 4)
  119. term.setBackgroundColor(colors.gray)
  120. term.setTextColor(colors.white)
  121. term.write("Initilizing ")
  122. rs.setBundledOutput("left", colours.pink)
  123. sleep(0.1)
  124. term.setCursorPos(24, 4)
  125. term.setTextColor(colors.lime)
  126. term.write("READY ")
  127. sleep(0.1)
  128. sleep(3)
  129. shell.run("menu")
  130. else
  131. os.reboot()
  132. end
  133.  
  134. -- ######################
  135. -- #### END LOGIN
  136. -- ######################
  137.  
  138. while true do
  139. term.setCursorPos(1, 1)
  140. term.setBackgroundColor(colors.gray)
  141. term.clear()
  142.  
  143. term.setTextColor(colors.white)
  144. term.setBackgroundColor(colors.red)
  145. term.clearLine()
  146.  
  147. term.setCursorPos(1, height)
  148. term.clearLine()
  149.  
  150. local text = "E.D.SYS"
  151. term.setCursorPos(math.floor((width - #text) / 2), 1)
  152. term.write(text)
  153.  
  154. -- ######################
  155. -- #### MENU
  156. -- ######################
  157.  
  158. term.setTextColor(colors.white)
  159. term.setBackgroundColor(colors.black)
  160. term.setCursorPos(5, 3)
  161. term.write(" MENU ")
  162. term.setCursorPos(5, 5)
  163. term.write(" A - Start Scuttle Procedure ")
  164. term.setCursorPos(5, 6)
  165. term.write(" ")
  166. term.setCursorPos(5, 7)
  167. term.write(" B - Scuttle System Check ")
  168. term.setCursorPos(5, 8)
  169. term.write(" ")
  170. term.setTextColor(colors.red)
  171. term.setBackgroundColor(colors.black)
  172. term.setCursorPos(5, 9)
  173. term.write(" C - Lock E.D.SYS ")
  174. term.setCursorPos(4, 14)
  175. term.setTextColor(colors.white)
  176. term.write("Option: ")
  177. local input = read()
  178.  
  179. -- ######################
  180. -- #### DOORS CLOSE
  181. -- ######################
  182.  
  183. if input == B then
  184. term.setCursorPos(1, 1)
  185. term.setBackgroundColor(colors.black)
  186. term.clear()
  187.  
  188. term.setTextColor(colors.white)
  189. term.setBackgroundColor(colors.red)
  190. term.clearLine()
  191.  
  192. term.setCursorPos(1, height)
  193. term.clearLine()
  194.  
  195. local text = "E.D.S."
  196. term.setCursorPos(math.floor((width - #text) / 2), 1)
  197. term.write(text)
  198.  
  199. term.setCursorPos(3, 3)
  200. term.setBackgroundColor(colors.black)
  201. term.setTextColor(colors.white)
  202. term.write("Closing E.D.S. Doors")
  203. rs.setBundledOutput("bottom", colours.pink)
  204. sleep(0.6)
  205. rs.setBundledOutput("bottom", colours.white)
  206. term.setCursorPos(25, 3)
  207. term.setBackgroundColor(colors.black)
  208. term.setTextColor(colors.lime)
  209. term.write("READY")
  210. sleep(2)
  211. term.clear()
  212. end
  213.  
  214. -- ######################
  215. -- ## SHUTDOWN SYSTEM
  216. -- ######################
  217.  
  218. if input == C then
  219. while true do
  220.  
  221. term.setCursorPos(1, 1)
  222. term.setBackgroundColor(colors.black)
  223. term.clear() -- fill the screen with white
  224.  
  225. term.setTextColor(colors.white)
  226. term.setBackgroundColor(colors.red)
  227. term.clearLine()
  228.  
  229. term.setCursorPos(1, height)
  230. term.clearLine()
  231.  
  232. local text = "E.D.S."
  233. term.setCursorPos(math.floor((width - #text) / 2), 1)
  234. term.write(text)
  235.  
  236. term.setBackgroundColor(colors.black)
  237. term.setTextColor(colors.white)
  238. term.setCursorPos(16,10)
  239. print("TERMINATE SYSTEM")
  240. term.setBackgroundColor(colors.black)
  241. term.setTextColor(colors.white)
  242. term.setCursorPos(17,11)
  243. sleep(1)
  244. os.reboot()
  245. end
  246. end
  247.  
  248. -- ######################
  249. -- #### PURGE SYSTEM
  250. -- ######################
  251.  
  252. if input == A then
  253. local width, height = term.getSize()
  254.  
  255. term.setCursorPos(1, 1)
  256. term.setBackgroundColor(colors.gray)
  257. term.clear()
  258.  
  259. term.setTextColor(colors.white)
  260. term.setBackgroundColor(colors.red)
  261. term.clearLine()
  262.  
  263. term.setCursorPos(1, height)
  264. term.clearLine()
  265.  
  266. local text = "E.D.SYS"
  267. term.setCursorPos(math.floor((width - #text) / 2), 1)
  268. term.write(text)
  269.  
  270. -- ######################
  271. -- #### STAGE 1 LOGIN
  272. -- ######################
  273.  
  274. term.setTextColor(colors.red)
  275. term.setBackgroundColor(colors.black)
  276. term.setCursorPos(5, 3)
  277. term.write(" DANGER ")
  278. term.setTextColor(colors.red)
  279. term.setBackgroundColor(colors.black)
  280. term.setCursorPos(5, 4)
  281. term.write(" EMERGENCY DESTRUCTION SYSTEM ")
  282. term.setTextColor(colors.yellow)
  283. term.setBackgroundColor(colors.black)
  284. term.setCursorPos(5, 5)
  285. term.write(" ON ACTIVATION IT WILL DETONATE IN ")
  286. term.setTextColor(colors.yellow)
  287. term.setBackgroundColor(colors.black)
  288. term.setCursorPos(5, 6)
  289. term.write(" T MINUS MINUTES ")
  290. term.setTextColor(colors.red)
  291. term.setBackgroundColor(colors.black)
  292. term.setCursorPos(25, 6)
  293. term.write("10")
  294.  
  295. term.setTextColor(colors.red)
  296. term.setBackgroundColor(colors.black)
  297. term.setCursorPos(5, 8)
  298. term.write(" FAILSAFE WARNING ")
  299. term.setTextColor(colors.yellow)
  300. term.setBackgroundColor(colors.black)
  301. term.setCursorPos(5, 9)
  302. term.write(" CUT-OFF SYSTEM WILL NOT OPERATE AFTER ")
  303. term.setTextColor(colors.yellow)
  304. term.setBackgroundColor(colors.black)
  305. term.setCursorPos(5, 10)
  306. term.write(" T MINUS MINUTES ")
  307. term.setTextColor(colors.red)
  308. term.setBackgroundColor(colors.black)
  309. term.setCursorPos(25, 10)
  310. term.write("5")
  311.  
  312. term.setCursorPos(13, 16)
  313. term.setBackgroundColor(colors.black)
  314. term.setTextColor(colors.yellow)
  315. term.write(" PRESS ENTER TO CONTINUE ")
  316.  
  317. term.setTextColor(colors.white)
  318. term.setBackgroundColor(colors.gray)
  319. local input = read("")
  320.  
  321. term.setCursorPos(13, 16)
  322. if input == agree then
  323. sleep(2)
  324. shell.run("purge")
  325. end
  326. end
  327. end
Advertisement
Add Comment
Please, Sign In to add comment