Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Setup
- local mon = peripheral.wrap("monitor_0")
- local reactor = peripheral.wrap("BigReactors-Reactor_0")
- os.loadAPI("touchpoint")
- local stats = touchpoint.new("monitor_0")
- local control = touchpoint.new("monitor_0")
- local page
- mon.clear()
- --Heading 1st Page
- stats:add("Reactor Statistics", nil, 1, 1, 29, 1, colors.blue, colors.blue)
- --button setup
- function controlscreen()
- page = control
- end
- function statsscreen()
- page = stats
- end
- stats:add("Reactor Controls", controlscreen, 12, 12, 29, 12, colors.lime, colors.lime)
- --Reactor Statistics
- stats:add(("Active: "..tostring(reactor.getActive())), nil, 1, 2, 15, 2, colors.black, colors.black)
- stats:add(("RF/t: "..tostring(reactor.getEnergyProducedLastTick())), nil, 1, 3, 11, 3, colors.black, colors.black)
- stats:add(("Energy In Reactor: "..tostring(reactor.getEnergyStored())), nil, 1, 4, 28, 4, colors.black, colors.black)
- stats:add(("Fuel Remaining: "..tostring(reactor.getFuelAmount()).."mb"), nil, 1, 5, 28, 5, colors.black, colors.black)
- stats:add(("Rod Insertion: "..tostring(reactor.getControlRodLevel(1)).."%"), nil, 1, 6, 22, 6, colors.black, colors.black)
- --End of statistics page, Start of Control page
- function reactoractive()
- reactor.setActive(not reactor.getActive())
- end
- control:add("Reactor Controls", nil, 1, 1, 29, 1, colors.blue, colors.blue)
- control:add("Reactor Statistics", statsscreen, 10, 12, 29, 12, colors.lime, colors.lime)
- control:add("Reactor On/Off", reactoractive, 1, 2, 1, 2, colors.red, colors.green)
- control:add(("Control Rod Insertion: "..tostring(reactor.getControlRodLevel(1)).."%"), nil, 1, 3, 20, 3, colors.black, colors.black)
- --Draw the screen
- statsscreen()
- while true do
- page:draw()
- local event, p1 = page:handleEvents(os.pullEvent())
- if event == "button_click" then
- page.buttonList[p1].func()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement