Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI('/core/Gui')
- local mon = peripheral.find('monitor')
- local reactor = peripheral.wrap('mekanism_machine_1')
- local laserAmp = peripheral.wrap('mekanism_machine_2')
- local inductionMatrix = peripheral.wrap('mekanism_machine_3')
- if not mon then error('No monitor found') end
- if not reactor then error('No reactor found') end
- if not laserAmp then error('No induction matrix found') end
- if not inductionMatrix then error('No induction matrix found') end
- Gui.Label:new({name = 'title',
- text = 'Fusion Reactor Control',
- bounds = {
- x1 = 14,
- x2 = 36,
- y1 = 1,
- y2 = 1
- }
- })
- Gui.Label:new({name = 'IM_output',
- text = '100 Rf/t',
- bounds = {
- x1 = 2,
- x2 = 10,
- y1 = 3,
- y2 = 3
- }
- })
- Gui.Label:new({name = 'IM_energy',
- text = '100 Rf/t',
- bounds = {
- x1 = 2,
- x2 = 10,
- y1 = 4,
- y2 = 4
- }
- })
- Gui.Bar:new({name = 'IM_percent',
- percent = 0,
- bounds = {
- x1 = 2,
- x2 = 10,
- y1 = 4,
- y2 = 4
- }
- })
- function updateIMData()
- Gui.labels.IM_output.text = inductionMatrix.getOutput()
- Gui.labels.IM_energy.text = inductionMatrix.getEnergy()
- Gui.bars.IM_percent.percent = math.floor((inductionMatrix.getEnergy() / inductionMatrix.getMaxEnergy() * 100) + 0.5)
- Gui.labels.IM_output:draw()
- Gui.labels.IM_energy:draw()
- Gui.bars.IM_percent:draw()
- end
- function main()
- while true do
- updateIMData()
- os.sleep(1)
- end
- end
- term.redirect(mon)
- Gui.draw()
- parallel.waitForAll(Gui.run, main)
Advertisement
Add Comment
Please, Sign In to add comment