Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitorprintcentred = function(text, side)
- local monitor = peripheral.wrap(side)
- local maxw, maxh = monitor.getSize() --screen dimensions
- local curx, cury = monitor.getCursorPos() --cursor pos
- monitor.setCursorPos((maxw-#text)/2,cury) --set it to the point where write will make the text centred
- monitor.write(text) --write the text
- monitor.setCursorPos(curx,cury+1) --return the cursor to the same position on the next line
- end
- local monitor = peripheral.wrap("left") -- makes 'monitor' refer to the monitor on the left side
- local maxw, maxh =monitor.getSize() --screen dimensions
- monitor.setCursorPos(1,math.floor(maxh/2))--set cursor to the start of the upper middle line
- monitorprintcentred("ATM","back")--print centred on that line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement