This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ScruffyRules's profile picture

Redpower bundles help and other things.

Started by ScruffyRules, 18 April 2013 - 04:01 AM
ScruffyRules #1
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.
Spongy141 #2
Posted 18 April 2013 - 01:58 PM
Err… I don't know to much about RP2, but if the clock sends a random redstone pulse, like the timer does, then do

if rs.getInput() then
  --code
end
-- Or if you want to do the bundle thing (Like I said I don't know much about RP2, so I don't use the redstone api with bundles cables) replace rs.getInput to the bundled version.