Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = peripheral.find("BigReactors-Reactor")
- os.loadAPI("ScreenAPI")
- function startup()
- ScreenAPI.resetSelection()
- ScreenAPI.setScreen({
- title = "Reactor Controller",
- options = {
- {
- option = "Status",
- func = status
- },
- {
- option = "Turn reactor " .. (reactor.getActive()) and "off" or "on",
- func = function()
- reactor.setActive(not reactor.getActive())
- startup()
- ScreenAPI.drawScreen()
- end
- },
- {
- option = "Exit",
- func = ScreenAPI.GetDefAPI().exitProgram
- }
- },
- static = {
- {
- text = "Reactor active: {1}",
- overrideY = ScreenAPI.GetMaxY(),
- variables = {
- reactor.getActive
- }
- }
- }
- })
- end
- startup()
- while true do
- ScreenAPI.GetDefAPI().awaitEvent()
- ScreenAPI.drawScreen()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement