Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function centerText(text, y, color)
- -- mon.clear()
- mX = mon.getSize()
- x = math.floor(mX/2) - math.floor(string.len(text)/2)
- mon.setCursorPos(x, y)
- mon.setTextColor(color)
- mon.write(text)
- end
- mon = peripheral.wrap("right")
- mon.clear()
- local lines = {}
- mon.setTextScale(0.75)
- mon.setBackgroundColor(colors.red)
- billboardFile = fs.open("billboard.txt", "r")
- i = 1
- text = billboardFile.readLine()
- repeat
- centerText(text,i,1)
- i = i + 1
- text = billboardFile.readLine()
- until text == nil
- billboardFile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement