Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("top")
- rednet.open("bottom")
- while true do
- id, msg, dist = rednet.receive()
- h = 0
- min = 1
- s = 23
- if msg == "Button1" then
- for i=1,(h*3600+min*60+s) do
- m.setCursorPos(1,8)
- m.setBackgroundColor(colors.orange)
- m.setTextColor(colors.blue)
- s=s-1
- if h >=10 then
- hstring = h
- else
- hstring = ("0" .. h)
- end
- if min >=10 then
- mstring = h
- else mstring = ("0" .. min)
- end
- if s >=10 then
- sstring = s
- else
- sstring = ("0" .. s)
- end
- m.write("Engines running!: " .. hstring .. ":" .. mstring .. ":" .. sstring)
- sleep(1)
- if s == 0 and min > 0 then
- min = min-1
- s = 60
- if min == 0 and h > 0 then
- h = h-1
- min = 59
- end
- end
- if s == 0 then
- m.setCursorPos(1,8)
- m.setBackgroundColor(colors.black)
- m.write(" ")
- m.setCursorPos(1,8)
- m.setBackgroundColor(colors.orange)
- m.setTextColor(colors.blue)
- m.write("Engines offline!")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement