local timerLength = 10 --Time in seconds local monitorLocation = "left" --The monitor location, it can be monitor_XXX or the side the monitor is on local redstoneSide = "right" --What side of the computer the redstone is on local monitor = peripheral.wrap(monitorLocation) -- I get a handle for the monitor rs.setOutput(redstoneSide, true) --put the redstone on for i=timerLength, 0, -1 do -- we start the countdown loop mon.clear()-- clear the monitor mon.write(i) -- write the current number sleep(1) -- let a second pass if i == 0 then --check if we have reached 0 rs.setOutput(redstoneSide, false) -- make it off end --close the if end --we close the loop
- ComputerCraft | Programmable Computers for Minecraft
- → Reddy360's Content
Reddy360's Content
There have been 2 items by Reddy360 (Search limited from 30-March 23)
#236904 Countdown timer
Posted by Reddy360 on 02 November 2015 - 05:57 PM in General
Thought I'd improve on Creator's example to make it easy for you to modify
#198580 Carbon -- Custom ROM's
- ComputerCraft | Programmable Computers for Minecraft
- → Reddy360's Content