Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- attachedMonitor = peripheral.wrap("bottom")
- attachedMonitor.setTextScale(2)
- attachedMonitor.setBackgroundColor(colors.green)
- attachedMonitor.setTextColor(colors.blue)
- attachedMonitor.clear()
- local function centerText(text)
- local x,y = attachedMonitor.getSize()
- local x2,y2 = attachedMonitor.getCursorPos()
- stringCen = math.ceil((x / 2) - (text:len() / 2))
- attachedMonitor.setCursorPos(stringCen + 1, y/2)
- attachedMonitor.write(text)
- end
- print("Please enter the text you want to write")
- local room = read()
- centerText(room)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement