Marlingaming

Reactor Control System

Jan 13th, 2021
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. function SystemStart()
  2. term.setBackgroundColour(2)
  3. term.setTextColour(1)
  4. term.clear
  5. term.write("Reactor Control")
  6. term.setCursorPos(1,3)
  7. term.write("Please Select Option\n")
  8. if isIgnited() == false then
  9. term.write("1-Start reactor\n")
  10. else
  11. term.write("1-Stop reactor\n")
  12. end
  13. term.write("2-Show System Status\n")
  14. term.write("3-Shutdown Computer\n")
  15. Menu()
  16. end
  17.  
  18. function Menu()
  19. while true do
  20. t = read()
  21. if t == 1 then
  22. if isIgnited() == true then
  23. print("Stopping Reactor\n")
  24. ReactorShutoff()
  25. else
  26. print("Starting Reactor\n")
  27. ReactorStartup()
  28. end
  29. elseif t == 2 then
  30.  
  31. elseif t == 3 then
  32.  
  33. end
  34. end
  35. end
  36.  
  37. function CheckOrders()
  38.  
  39. end
  40.  
  41. function ReactorStartup()
  42. speechBox.say("Reactor Starting")
  43. setOutput("bottom", true)
  44. sleep(4)
  45. while getProducing() < 700000000 do
  46. print("Waiting")
  47. end
  48. end
  49.  
  50. function ReactorShutoff()
  51.  
  52. end
  53.  
  54. SystemStart()
Advertisement
Add Comment
Please, Sign In to add comment