a guest Oct 13th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand