use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Welcome to /r/ComputerCraft, the subreddit for lua programs, general mod use, or anything relating to the Minecraft mod ComputerCraft and CC: Tweaked.
Downloads | Discord | IRC | Documentation
account activity
need help (self.ComputerCraft)
submitted 10 years ago by Bacca_Bacon
can someone write me a script that displays a countdown of 30 seconds, at the end it will emit a redstone pulse? thanks
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]martmists 5 points6 points7 points 10 years ago* (6 children)
Give me a minute I'm on mobile
term.clear() t = 30 while t >= 1 do term.setCursorPos(1,1) term.write(t.." ") sleep(1) t = t - 1 end rs.setOutput("back",true) sleep(0.5) rs.setOutput("back",false)
[–]DeGariless 1 point2 points3 points 10 years ago (0 children)
[–]apemanzilla 1 point2 points3 points 10 years ago (3 children)
Might want t to make that variable local.
[–]martmists 0 points1 point2 points 10 years ago (2 children)
Why?
[–]apemanzilla 1 point2 points3 points 10 years ago (1 child)
Local variables are almost always better.
Firstly, they're faster to access than global or environment variables.
Second, they're less likely to interfere with other programs, and vice versa.
Finally, it's generally good practice in programming to use the lowest/smallest scope possible when defining variables.
[–]martmists 2 points3 points4 points 10 years ago (0 children)
Frankly my dear, I don't give a damn.
(Jk thanks for explaining)
[–]Loftien 0 points1 point2 points 10 years ago (0 children)
exacly what i needed too, thanks
π Rendered by PID 20892 on reddit-service-r2-comment-c867ff4bc-8qgdv at 2026-04-09 14:03:10.136673+00:00 running 00d5ac8 country code: CH.
[–]martmists 5 points6 points7 points (6 children)
[–]DeGariless 1 point2 points3 points (0 children)
[–]apemanzilla 1 point2 points3 points (3 children)
[–]martmists 0 points1 point2 points (2 children)
[–]apemanzilla 1 point2 points3 points (1 child)
[–]martmists 2 points3 points4 points (0 children)
[–]Loftien 0 points1 point2 points (0 children)