Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- monitor should be 4 high and 6 wide
- -- remember to check modem side and receiver ID
- s = 0
- m = 0
- h = 0
- x = 0
- z = 0
- function sendTime()
- zero = "0"
- second = tostring(s)
- minute = tostring(m)
- hour = tostring(h)
- if s<10 then
- sendSec = zero..second
- else sendSec = second
- end
- if m<10 then
- sendMin = zero..minute
- else sendMin = minute
- end
- if h<10 then
- sendHour = zero..hour
- else sendHour = hour
- end
- rednet.open("right")
- time = sendHour..":"..sendMin..":"..sendSec
- rednet.send(69, tostring(time))
- end
- print("Runnnig")
- while true do
- mon = peripheral.wrap("back")
- mon.clear()
- mon.setTextScale(5)
- mon.setCursorPos(2,3)
- mon.setCursorPos(1,1)
- mon.setTextScale(5)
- mon.write("Time Elapsed")
- mon.setCursorPos(2,3)
- if s<10 then
- s = ("0" .. s)
- end
- if m<10 then
- mon.write(" 0" .. h .. ":" .. "0" .. m .. ":" .. s)
- else
- mon.write(" 0" .. h .. ":" .. m .. ":" .. s)
- end
- s = (s+1)
- sleep(1)
- sendTime()
- if s>59 then
- s = 0
- m = (m+1)
- end
- if m>59 then
- m = 0
- h = (h+1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement