Advertisement
maxtorcd55

Untitled

Apr 9th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. local moniter = peripheral.wrap('bottom')
  2. local hour
  3. local min
  4. local sec
  5. time = http.get("http://des.servegame.com:2223/time.php")
  6. if not time then
  7. print("offline")
  8. else
  9. local timetable = textutils.unserialize(time.readAll())
  10. hour = timetable[4]
  11. min = timetable[5]
  12. sec = timetable[6]
  13. end
  14. time.close()
  15.  
  16.  
  17. while true do
  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. min = min + 1
  29. sec = 0
  30. if min == 60 then
  31. min = 0
  32. hour = hour + 1
  33. end
  34.  
  35. time.close()
  36.  
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement