Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("top")
- local function centerText(text)
- local x,y = monitor.getSize()
- local x2,y2 = monitor.getCursorPos()
- monitor.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- monitor.write(text)
- end
- centerText("Hello World")
Advertisement
Add Comment
Please, Sign In to add comment