Guest User

Reactor Program CC

a guest
Aug 19th, 2016
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. i=1
  4. while i == 1 do
  5. function reactor()
  6. A = rs.getInput("back")
  7. if A == true then
  8. print("ON")
  9. else
  10. print("OFF")
  11. end
  12. end
  13. function coolant()
  14. B = rs.getInput("left")
  15. if B == true then
  16. print("OFF")
  17. else
  18. print("ON")
  19. end
  20. end
  21. function uranium()
  22. C = rs.getInput("right")
  23. if C == true then
  24. print("OFF")
  25. else
  26. print("ON")
  27. end
  28. end
  29. function uranium2()
  30. F = rs.getInput("right")
  31. if F == true then
  32. rs.setOutput("right",true)
  33. else
  34. rs.setOutput("right",false)
  35. end
  36. end
  37. function reactor2()
  38. D = rs.getInput("back")
  39. if D == true then
  40. rs.setOutput("back",true)
  41. else
  42. rs.setOutput("back",false)
  43. end
  44. end
  45. function coolant2()
  46. E = rs.getInput("left")
  47. if E == true then
  48. rs.setOutput("left",true)
  49. else
  50. rs.setOutput("left",false)
  51. end
  52. end
  53. print("-=Reactor Control V.03=-")
  54. write(" -Reactor Status: ")
  55. reactor()
  56. write(" -Coolant Flow: ")
  57. coolant()
  58. write(" -Uranium Refill: ")
  59. uranium()
  60. print()
  61. print("What option would you like to change:")
  62. print("reactor | coolant | uranium")
  63. write("Type Option:: ")
  64. input = read()
  65. if input =="reactor" then
  66. reactor2()
  67. os.restart()
  68. end
  69. if input =="coolant"then
  70. coolant2()
  71. os.restart()
  72. end
  73. if input=="uranium"then
  74. uranium2()
  75. os.restart()
  76. end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment