Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. --this function will print the text in the centre of the current line
  2. local printcentred =
  3. function(text)
  4. local maxw, maxh = term.getSize() --screen dimensions
  5. local curx, cury = term.getCursorPos() --cursor pos
  6. term.setCursorPos((maxw-#text)/2,cury) --set it to the point where write will make the text centred
  7. term.write(text) --write the text
  8. term.setCursorPos(curx,cury+1) --return the cursor to the same position on the next line
  9. end
  10. local maxw, maxh = term.getSize() --screen dimensions
  11. term.setCursorPos(1,math.floor(maxh/2))--set cursor to the start of the upper middle line
  12. monitor.setTextscale(4)
  13. printcentred("ATM")--print centred on that line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement