Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local moniter = peripheral.wrap('bottom')
- local hour
- local min
- local sec
- time = http.get("http://des.servegame.com:2223/time.php")
- if not time then
- print("offline")
- else
- local timetable = textutils.unserialize(time.readAll())
- hour = timetable[4]
- min = timetable[5]
- sec = timetable[6]
- end
- time.close()
- while true do
- while sec ~= 60 do
- moniter.clear()
- moniter.setCursorPos(1, 1)
- moniter.write(string.format("%.2d:%.2d:%.2d", hour,min,sec))
- sleep(1)
- sec = sec + 1
- end
- min = min + 1
- sec = 0
- if min == 60 then
- min = 0
- hour = hour + 1
- end
- time.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement