Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Settings]]--
- local text =
- {
- "line1",
- "line2",
- "line3"
- }
- local monitorSide = "top"
- local textScale = 1
- --[[Variables & peripherals]]--
- monitor = peripheral.wrap(monitorSide)
- --[[Functions]]--
- local function round(number)
- return math.floor(number + 0.5)
- end
- --[[Main program]]--
- monitor.clear()
- local width, height = monitor.getSize()
- monitor.setTextScale(textScale)
- local yPos = round(height / 2 - #text / 2)
- for i, textLine in pairs(text) do
- print(textLine)
- local xPos = round(width / 2 - #textLine / 2)
- monitor.setCursorPos(xPos, yPos + i)
- monitor.write(textLine)
- end
Advertisement
Add Comment
Please, Sign In to add comment