Advertisement
Guest User

Working Code

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