EliteAnax17

bunker script

Jan 16th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. --coded by eliteanax17
  2.  
  3. local gpu = require("component").gpu
  4. local term = require("term")
  5.  
  6. local refresh_rate = 1
  7.  
  8. gpu.setForeground(0xFFFFFF) -- default OS color
  9.  
  10. term.clear()
  11.  
  12. function round(t)
  13. return math.floor(t*10)*0.1
  14. end
  15.  
  16. number = 16
  17.  
  18. gpu.setResolution(round(number * 2), number)
  19.  
  20. term.write("Initiate sleep mode? (y/n): ")
  21. choice = term.read()
  22.  
  23. statuscolor = 0xEEEEEE
  24. activecolor = 0x00FF00
  25. inactivecolor = 0xFF0000
  26.  
  27. if choice == "y\n" then -- the \n is needed to mask the input correctly. very dumb.
  28. term.clear()
  29. gpu.setForeground(statuscolor)
  30. gpu.set(1, 1, "-------STATUS-------")
  31. gpu.set(1, 3, "Stasis Pod #1: ")
  32. gpu.set(1, 4, "Stasis Pod #2: ")
  33. gpu.set(1, 5, "Stasis Pod #3: ")
  34. gpu.set(1, 6, "Stasis Pod #4: ")
  35. gpu.set(1, 7, "Stasis Pod #5: ")
  36. gpu.set(1, 8, "Stasis Pod #6: ")
  37. gpu.set(1, 9, "Stasis Pod #7: ")
  38. gpu.set(1, 10, "Stasis Pod #8: ")
  39. gpu.setForeground(activecolor)
  40. gpu.set(16, 3, "ACTIVE")
  41. gpu.set(16, 4, "ACTIVE")
  42. gpu.set(16, 5, "ACTIVE")
  43. gpu.set(16, 6, "ACTIVE")
  44. gpu.set(16, 7, "ACTIVE")
  45. gpu.set(16, 8, "ACTIVE")
  46. gpu.set(16, 9, "ACTIVE")
  47. gpu.set(16, 10, "ACTIVE")
  48. gpu.setForeground(statuscolor)
  49. gpu.set(1, 12, "Program is currently in")
  50. gpu.setForeground(0xAAAAFF)
  51. gpu.set(1, 13, "Protection Mode")
  52. gpu.setForeground(statuscolor)
  53. gpu.set(17, 13, "and will")
  54. gpu.set(1, 14, "continue to run until an")
  55. gpu.set(1, 15, "overworld status of")
  56. gpu.setForeground(activecolor)
  57. gpu.set(21, 15, "ALL-CLEAR")
  58. gpu.setForeground(statuscolor)
  59. gpu.set(1, 16, "is determined.")
  60. repeat
  61. os.sleep(refresh_rate) -- do nothing
  62. until false
  63. else
  64. term.write("Terminating program...")
  65. end
Add Comment
Please, Sign In to add comment