Advertisement
tuturox

Untitled

Aug 8th, 2022
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.29 KB | None | 0 0
  1. m = peripheral.find("monitor")
  2. local event, key = os.pullEvent("key")
  3.  
  4.  
  5.  
  6. local function centerText(text)
  7.     local x,y = m.getSize()
  8.     local x2,y2 = m.getCursorPos()
  9.     m.setCursorPos(math.ceil((x/2)-(text:len()/2)), math.ceil(y/2))
  10.     m.write(text)
  11. end
  12.  
  13. centerText("Hello World")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement