Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitorside = "back"
- mon = peripheral.wrap(monitorside)
- local x,y = mon.getSize()
- function Background()
- for i=1,y do
- mon.setCursorPos(1,i)
- mon.setBackgroundColor(colors.white)
- for j=1,x do
- mon.write(" ")
- end
- end
- end
- function bdraw(xp1,yp1,xp2,yp2,txt,col)
- if col==nil then
- mon.setBackgroundColor(colors.lime)
- else
- mon.setBackgroundColor(col)
- end
- mon.setCursorPos(xp1,yp1)
- for i=1,(xp2-xp1) do
- mon.write("-")
- end
- mon.setCursorPos(xp1,yp2)
- for i=1,(xp2-xp1) do
- mon.write("-")
- end
- for i=yp1,yp2 do
- mon.setCursorPos(xp1,i)
- mon.write("|")
- mon.setCursorPos(xp2,i)
- mon.write("|")
- end
- for i=(yp1+1),(yp2-1) do
- mon.setCursorPos((xp1+1),i)
- for j=(xp1+1),(xp2-1) do
- mon.write(" ")
- j = j+1
- end
- i = i+1
- end
- if math.floor(((xp2-xp1)-#txt)/2)==0 then
- xp1 = xp1+1
- end
- mon.setCursorPos(math.floor(((xp2-xp1)-#txt)/2)+xp1,math.floor((yp2-yp1)/2)+yp1)
- print(math.floor(((xp2-xp1)-#txt)/2))
- mon.write(txt)
- end
- Background()
- mon.setTextColor(colors.black)
- mon.setCursorPos(13,1)
- mon.write("Haussteuerung")
- mon.setTextColor(colors.blue)
- mon.setCursorPos(1,3)
- mon.write("Automatische Erzschmelze: ")
- mon.setCursorPos(1,4)
- mon.write("Mass Fabricator: ")
- mon.setCursorPos(1,5)
- mon.write("Crystallizer: ")
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.black)
- mon.write("---------------------------------------")
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.cyan)
- mon.write("Haustuer: ")
- mon.setCursorPos(1,9)
- mon.setTextColor(colors.black)
- mon.write("---------------------------------------")
- mon.setCursorPos(1,11)
- mon.setTextColor(colors.lightBlue)
- mon.write("ME-Home System: ")
- mon.setCursorPos(1,12)
- mon.setTextColor(colors.orange)
- mon.write("Me-Home Notstrom: ")
- while true do
- if rs.testBundledInput("front", colors.green) then
- mon.setCursorPos(26,3)
- mon.setTextColor(colors.lime)
- mon.write("(AN) ")
- else
- mon.setCursorPos(26,3)
- mon.setTextColor(colors.red)
- mon.write("(AUS)")
- end
- if rs.testBundledInput("front", colors.red) then
- mon.setCursorPos(26,4)
- mon.setTextColor(colors.lime)
- mon.write("(AN) ")
- else
- mon.setCursorPos(26,4)
- mon.setTextColor(colors.red)
- mon.write("(AUS)")
- end
- if rs.testBundledInput("front", colors.blue) then
- mon.setCursorPos(31,4)
- mon.setTextColor(colors.orange)
- mon.write("(Tag) ")
- else
- mon.setCursorPos(31,4)
- mon.setTextColor(colors.black)
- mon.write("(Nacht)")
- end
- if rs.testBundledInput("front", colors.brown) then
- mon.setCursorPos(26,5)
- mon.setTextColor(colors.lime)
- mon.write("(AN) ")
- else
- mon.setCursorPos(26,5)
- mon.setTextColor(colors.red)
- mon.write("(AUS)")
- end
- if rs.testBundledInput("front", colors.purple) then
- mon.setCursorPos(26,8)
- mon.setTextColor(colors.lime)
- mon.write("(AUF)")
- else
- mon.setCursorPos(26,8)
- mon.setTextColor(colors.red)
- mon.write("(ZU) ")
- end
- if rs.testBundledInput("front",colors.yellow) then
- mon.setCursorPos(31,8)
- mon.setTextColor(colors.orange)
- mon.write("(Klingel)")
- sleep(0.5)
- mon.setCursorPos(31,8)
- mon.write(" ")
- sleep(0.5)
- mon.setCursorPos(31,8)
- mon.write("(Klingel)")
- mon.setCursorPos(31,8)
- sleep(0.5)
- mon.write(" ")
- mon.setCursorPos(31,8)
- sleep(0.5)
- mon.write("(Klingel)")
- sleep(0.5)
- mon.setCursorPos(31,8)
- mon.write(" ")
- end
- mon.setCursorPos(1,9)
- mon.setTextColor(colors.black)
- mon.write("---------------------------------------")
- if rs.testBundledInput("front",colors.cyan) then
- mon.setCursorPos(26,11)
- mon.setTextColor(colors.red)
- mon.write("(AUS)")
- else
- mon.setCursorPos(26,11)
- mon.setTextColor(colours.lime)
- mon.write("(AN) ")
- end
- if rs.testBundledInput("front",colors.orange) then
- mon.setCursorPos(26,12)
- mon.setTextColor(colors.red)
- mon.write("(AUS)")
- else
- mon.setCursorPos(26,12)
- mon.setTextColor(colors.lime)
- mon.write("(AN) ")
- end
- bdraw(x-8,y-2,x,y,"zurueck",colors.red)
- event,_,xPos,yPos = os.pullEvent()
- if event=="monitor_touch" then
- if xPos>=x-8 and xPos<=x and yPos>=y-2 and yPos<=y then
- os.reboot()
- end
- end
- end
Add Comment
Please, Sign In to add comment