Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m = peripheral.wrap("monitor_66")
- local r = peripheral.wrap("back")
- local m_lu = 0
- m.setTextScale(1)
- function draw()
- m.setCursorPos(1,1)
- m.setBackgroundColor(32768)
- m.setTextColor(1)
- m.clear()
- m.setBackgroundColor(2048)
- m.clearLine()
- m.setBackgroundColor(128)
- for i=2,22,1 do
- m.setCursorPos(1, i)
- m.clearLine()
- end
- m.setCursorPos(1,1)
- m.setBackgroundColor(2048)
- if r == nil then
- m.setTextColor(16384)
- m.write("NOT CONNECTED")
- else
- if r.getConnected() then
- m.setTextColor(2)
- m.write("Status")
- if r.getActive() then
- m.setCursorPos(14,1)
- m.setTextColor(8192)
- m.write("AKTIV")
- else
- m.setCursorPos(12,1)
- m.setTextColor(16384)
- m.write("INAKTIV")
- end
- m.setTextColor(1)
- m.setCursorPos(1,3)
- m.setBackgroundColor(128)
- m.write("Reaktor ")
- if r.getActive() then
- m.setTextColor(16384)
- m.write("DEAKTIVIEREN")
- else
- m.setTextColor(8192)
- m.write("AKTIVIEREN")
- end
- m.setCursorPos(1,4)
- m.setTextColor(1)
- m.write("Brennstaebe: ")
- m.setTextColor(2)
- m.write(r.getNumberOfControlRods())
- m.setCursorPos(1,6)
- m.setTextColor(1)
- m.write("Energie: ")
- m.setTextColor(2048)
- m.write(r.getEnergyStored() .. "RF")
- m.setCursorPos(1,5)
- m.setTextColor(1)
- m.write("Fuel: ")
- m.setTextColor(2)
- m.write(r.getFuelAmount() / 1000)
- local perc = math.floor((r.getFuelAmount() / r.getFuelAmountMax()) * 100)
- m.write(" [" .. perc .. "%]")
- m.setCursorPos(1,12)
- m.setTextColor(1)
- m.write("Beenden")
- else
- m.setTextColor(16384)
- m.write("NOT CONNECTED")
- end
- end
- end
- draw()
- while true do
- os.startTimer(0.5)
- local ev, btn, x, y = os.pullEvent()
- if ev == "monitor_touch" then
- if y == 3 and x >=9 and x <= 19 then
- r.setActive(not r.getActive())
- elseif y == 12 and x >= 1 and x <= 8 then
- m.setBackgroundColor(32768)
- m.clear()
- error()
- end
- elseif ev == "timer" then
- draw()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement