Posted 18 April 2013 - 06:01 AM
Is there any way that you could hook that code up to a 4 digit RP2 clock and have it countdown as the time passes by?
print("How much time?")
print("")
write("Minutes: ")
minutes = read()
print("")
write("Seconds: ")
seconds = read()
clocktime = minutes+seconds
repeat
if seconds == 0 then
minutes = minutes-1
seconds = 60 -- 60 because it's about to get counted down again
end
if minutes == -1 then
break
end
seconds = seconds-1
if seconds < 10 then
zero = 0
else
zero = ""
end
sleep(1)
print("Time Remaining: "..minutes.." Minutes and "..seconds.." Seconds")
until minutes == -1
sleep(0.2)
print("TIME IS UP!")
sleep(5)
EDIT: Doing this for a friend because there a lazy bum.