Advertisement
AlwayzPatty

Untitled

Nov 16th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. local reactor = peripheral.find("BigReactors-Reactor")
  2. os.loadAPI("ScreenAPI")
  3.  
  4. function startup()
  5. ScreenAPI.resetSelection()
  6. ScreenAPI.setScreen({
  7. title = "Reactor Controller",
  8. options = {
  9. {
  10. option = "Status",
  11. func = status
  12. },
  13. {
  14. option = "Turn reactor " .. (reactor.getActive()) and "off" or "on",
  15. func = function()
  16. reactor.setActive(not reactor.getActive())
  17. startup()
  18. ScreenAPI.drawScreen()
  19. end
  20. },
  21. {
  22. option = "Exit",
  23. func = ScreenAPI.GetDefAPI().exitProgram
  24. }
  25. },
  26. static = {
  27. {
  28. text = "Reactor active: {1}",
  29. overrideY = ScreenAPI.GetMaxY(),
  30. variables = {
  31. reactor.getActive
  32. }
  33. }
  34. }
  35. })
  36. end
  37.  
  38. startup()
  39.  
  40. while true do
  41. ScreenAPI.GetDefAPI().awaitEvent()
  42. ScreenAPI.drawScreen()
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement