Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Program na monitor 3x1 - Nazov miestnosti By Sparta252
- mon = peripheral.wrap("bottom")
- mon.setTextScale(1)
- x,y = mon.getSize()
- mon.clear()
- mon.setTextColor(colors.cyan)
- for i=1, x do
- mon.setCursorPos(i,1)
- mon.write("#")
- mon.setCursorPos(i,y)
- mon.write("#")
- end
- for i=1, y do
- mon.setCursorPos(1,i)
- mon.write("#")
- mon.setCursorPos(x,i)
- mon.write("#")
- end
- mon.setTextColor(colors.green)
- bambus = fs.open("text.lua","r")
- alfa = bambus.readLine()
- bambus.close()
- if string.len(alfa) > x then
- print("Chyba : Dlhy text : ".. string.len(alfa))
- print("Vase X : "..x)
- elseif string.len(alfa) < x then
- mon.setCursorPos(x/2+1-(string.len(alfa)/2),3)
- mon.write(alfa)
- else
- print("CHYBA")
- end
- repeat
- sleep(30)
- os.reboot()
- until nil
Advertisement
Add Comment
Please, Sign In to add comment