Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- -- Peripherals
- m = peripheral.wrap("top")
- m.clear()
- m.setCursorPos(1,1)
- -- CenterText
- local function centerText(text)
- x,y = m.getSize()
- x1,y1 = m.getCursorPos()
- m.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
- m.write(text)
- end
- -- Time
- function time()
- repeat
- local nTime = os.time()
- m.setTextColor(16845)
- centerText(""..textutils.formatTime(nTime, false))
- sleep(1)
- term.clear()
- until nil
- end
- -- Title
- function title()
- m.write("OS")
- end
- -- Functions
- title()
- time()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement