meuced

heure

Jul 12th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. monitor = peripheral.wrap("right") -- Moved the initialization out of the loop
  2. monitor.setTextScale(1)
  3.  
  4. repeat  
  5.   term.clear()  -- Moved to start of loop to handle case where cursor is somewhere weird to begin with
  6.   term.setCursorPos( 1, 1 )
  7.   local nTime = os.time()
  8.   print( "The time is "..textutils.formatTime( nTime, false ) )
  9.  
  10.   if nTime < 18 and nTime > 6 then
  11.         print("Have a good day!")
  12.   else
  13.         print("Have a good night!")
  14.   end
  15.  
  16.   sleep(1)
  17.  
  18. until nil
Add Comment
Please, Sign In to add comment