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