Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Go...")
- function drawMon()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(2,2)
- if g.getActive() == true then
- mon.setBackgroundColor(colors.lime)
- mon.write("ON ")
- else
- mon.setBackgroundColor(colors.red)
- mon.write("OFF")
- end
- for i = 1,10 do
- mon.setBackgroundColor(colors.yellow)
- mon.setCursorPos(6,i+1)
- mon.write(" ")
- mon.setBackgroundColor(colors.black)
- end
- eS = g.getEnergyStored()
- eSt = g.getEnergyProducedLastTick()
- cT = g.getCasingTemperature()
- mon.setCursorPos(10,2)
- mon.write("Energy: "..eS)
- mon.setCursorPos(10,3)
- mon.write("Energy/T: "..eSt)
- mon.setCursorPos(10,4)
- mon.write("Casingtemp.: "..cT)
- cfr = g.getControlRodLevel(0)
- mon.setCursorPos(6,(cfr+10)/10)
- mon.setBackgroundColor(colors.red)
- mon.write(" ")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(10,5)
- mon.write("Fuel-Rod: "..cfr.."%")
- end
- drawMon()
- while true do
- timer = os.startTimer(1)
- local event,side,x,y = os.pullEvent()
- if event == "timer" then
- drawMon()
- elseif event == "monitor_touch" then
- if x > 1 and x < 5 and y == 2 then
- if g.getActive() == true then
- g.setActive(false)
- drawMon()
- else
- g.setActive(true)
- drawMon()
- end
- elseif x > 5 and x < 9 and y > 1 and y < 12 then
- crs = (y-1)*10
- g.setAllControlRodLevels(crs)
- drawMon()
- end
- elseif event == "key" then
- print("Broke Loop Through Button")
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement