FrostyJockey

Clock (ACTUAL)

May 17th, 2021 (edited)
621
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function centerPrint( text, y, mon )
  2.         local w, h = mon.getSize() or term.getSize()
  3.         if mon then
  4.                 mon.setCursorPos( math.ceil( w/2 - #text/2 + 1 ), y )
  5.                 mon.write( text )
  6.         else
  7.                 term.setCursorPos( math.ceil( w/2 - #text/2 ), y )
  8.                 term.write( text )
  9.         end
  10. end
  11.  
  12. shell.run("bg FTP receive 0 \"ACCESS_DENIED\"")
  13.  
  14. local mon = peripheral.wrap("left")
  15. local monW, monH = mon.getSize()
  16. mon.setTextScale(3)
  17.  
  18. while true do
  19.     os.startTimer(0.5) -- .5 second timer
  20.     os.pullEvent("timer")
  21.    
  22.     local time = os.time()
  23.     local formattedTime = textutils.formatTime(time, false)
  24.    
  25.     mon.clear()
  26.     centerPrint(formattedTime, (monH/2), mon)
  27. end
RAW Paste Data