Advertisement
MajorVictory

ComputerCraft MonitorText

Mar 26th, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.30 KB | None | 0 0
  1. local sText = "1"
  2. local sSide = "back"
  3.  
  4. local function printCenter(mon, txt)
  5.   local w, h = mon.getSize()
  6.   local x = math.floor((w / 2) - (#txt / 2))
  7.   local y = math.floor((h / 2))
  8.   mon.setCursorPos(x, y)
  9.   mon.write(txt)
  10. end
  11.  
  12. local monitor = peripheral.wrap(sSide)
  13. printCenter(monitor, sText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement