Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem=peripheral.wrap("back")
- modem.open(156)
- pad=0
- -- Fields, as defined in the reactor management program.
- info={"Energy Stored:","Max Energy:","Energy Percent:","Production:","Fuel usage:","Fuel rod level:"}
- values={0,0,0,0,0,0}
- units={" RF"," RF","% RF"," RF/t"," b/h","%"}
- function Receive()
- while true do
- local event,side,sch,rch,message,dist=os.pullEvent("modem_message")
- values=textutils.unserialize(message)
- sleep(2.5)
- end
- end
- function Draw()
- while true do
- term.setBackgroundColor(colors.black)
- term.clear()
- -- Title
- term.setCursorPos(2,2)
- term.setBackgroundColor(colors.purple)
- term.setTextColor(colors.yellow)
- term.write("NMDanny's Reactor Control v1")
- -- Print data
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- for i=1,#info,1 do
- term.setCursorPos(2,3+i)
- term.write(info[i]..values[i]..units[i])
- end
- sleep(2.5)
- end
- end
- while true do
- parallel.waitForAny(Receive,Draw)
- end
Advertisement
Add Comment
Please, Sign In to add comment