Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Monitor und Sensorseite
- monSide = "front"
- senSide = "top"
- mon = peripheral.wrap(monSide)
- function start()
- os.loadAPI("ocs/apis/sensor")
- sen = sensor.wrap(senSide)
- mon.clear()
- mon.setTextColor(colors.white)
- mon.setCursorPos(8,1)
- mon.write("Reactor Uebersicht")
- mon.setCursorPos(8,2)
- mon.write("made by ")
- mon.setTextColor(colors.orange)
- mon.write("Nike622000")
- end
- start()
- while true do
- i=1
- h=1
- for a,b in pairs(sen.getTargets()) do
- if b.Name == "Nuclear Reactor" then
- print("Reaktor detected")
- for k,v in pairs(sen.getTargetDetails(a)) do
- if type(v)== "table" then
- else
- yPos = i+6
- if k == "Active" then
- yPos = i+6
- mon.setTextColor(colors.white)
- mon.setCursorPos(12,4)
- mon.write("Status: ")
- if v == true then
- yPos2 = h+6
- mon.setTextColor(colors.lime)
- mon.setCursorPos(14,yPos)
- mon.write("AN ")
- else
- mon.setTextColor(colors.red)
- mon.setCursorPos(14,yPos)
- mon.write("Aus")
- end
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,4)
- mon.write("Reaktor: ")
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,yPos)
- mon.write("Reaktor "..i)
- i=i+1
- end
- if k == "Output" then
- yPos2 = h+6
- mon.setTextColor(colors.white)
- mon.setCursorPos(20,4)
- mon.write("Output: ")
- mon.setTextColor(colors.white)
- mon.setCursorPos(20,yPos2)
- mon.write(v.." eu/t ")
- h=h+1
- end
- sleep(0.1)
- end
- end
- end
- end
- for l = 10, 0, -1 do
- sleep(1)
- mon.setCursorPos(10,3)
- mon.setTextColor(colors.red)
- mon.write("Refresh in "..l.." ")
- if l == 0 then
- mon.setCursorPos(10,3)
- mon.write(" ")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment