Advertisement
maxtorcd55

time

Apr 8th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. local moniter = peripheral.wrap('top')
  2. local hour
  3. local min
  4. local sec
  5.  
  6.  
  7. while true do
  8.  
  9. time = http.get("http://des.servegame.com:2223/time.php")
  10. if not time then
  11. print("offline")
  12. else
  13. local timetable = textutils.unserialize(time.readAll())
  14. hour = timetable[4]
  15. min = timetable[5]
  16. sec = timetable[6]
  17.  
  18.  
  19. while sec ~= 60 do
  20. moniter.clear()
  21. moniter.setCursorPos(1, 1)
  22.  
  23. moniter.write(string.format("%.2d:%.2d:%.2d", hour,min,sec))
  24. sleep(1)
  25.  
  26. sec = sec + 1
  27. end
  28.  
  29. end
  30. time.close()
  31.  
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement