Discuss Scratch
- Discussion Forums
- » Suggestions
- » "Repeat for ___ secs" blocks
- anguz110
- Scratcher
46 posts
"Repeat for ___ secs" blocks
I think there should be repeat blocks that don't repeat a given number of times, but for a given number of seconds.
How it works is, there's a repeat block like this:
Then you enter how many seconds you want it to repeat.
Please give feedback
How it works is, there's a repeat block like this:
repeat (for ___ seconds?)
end
Then you enter how many seconds you want it to repeat.
Please give feedback
- jh1234l
- Scratcher
100+ posts
"Repeat for ___ secs" blocks
It can be worked around:
repeat until <(timer) = [?]>Or you can use a variable, if you have another spite that uses the timer.
move () steps
end
Last edited by jh1234l (Nov. 21, 2013 05:02:59)
- cobraguy
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
Adding on to @jh1234I's answer, you would want to reset the timer before using the repeat until block.
It's because the timer automatically starts on the launch of the program, and there is no way to stop it.
reset timer
repeat until <(timer) = [?]>
do stuff
end
It's because the timer automatically starts on the launch of the program, and there is no way to stop it.
Last edited by cobraguy (Nov. 21, 2013 16:10:05)
- Firedrake969
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
fixed xD Adding on to @jh1234I's answer, you would want to reset the timer before using the repeat until block.reset timer
repeat until <(timer) = [?]>
do stuff//category=grey
end
It's because the timer automatically starts on the launch of the program, and there is no way to stop it.
No support. Easy workaroud.
- RPFluffy
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
It can be worked around:repeat until <(timer) = [?]>Or you can use a variable, if you have another spite that uses the timer.
move () steps
end
Adding on to @jh1234I's answer, you would want to reset the timer before using the repeat until block.reset timer
repeat until <(timer) = [?]>
do stuff
end
It's because the timer automatically starts on the launch of the program, and there is no way to stop it.
- VoltageGames
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
No support.
If I have a script like
repeat for 10 seconds,
with a wait 11 seconds in it, what happens?
If I have a script like wait 10 seconds
with blocks inside of it,
what happens when the 10 seconds are up and it's in the middle of the scripts?
Will the rest of the scripts inside continue even though the 10 secs are up? Or will they stop and skip ahead of the repeat?
If I have a script like
repeat for 10 seconds,
with a wait 11 seconds in it, what happens?
If I have a script like wait 10 seconds
with blocks inside of it,
what happens when the 10 seconds are up and it's in the middle of the scripts?
Will the rest of the scripts inside continue even though the 10 secs are up? Or will they stop and skip ahead of the repeat?
- DevanWolf
- Scratcher
100+ posts
"Repeat for ___ secs" blocks
repeat(1280)secs::control cstart
say(join[Bump #](timer))
- MathlyCat
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
^^^No support as per the workaroundIt can be worked around:repeat until <(timer) = [?]>Or you can use a variable, if you have another spite that uses the timer.
move () steps
endAdding on to @jh1234I's answer, you would want to reset the timer before using the repeat until block.reset timer
repeat until <(timer) = [?]>
do stuff
end
It's because the timer automatically starts on the launch of the program, and there is no way to stop it.
repeat(1280)secs::control cstart
say(join[Bump #](timer))
Dat necro man…. meh, suggestion forums r boss
P.S. DevanWolf, please don't troll by removing the [/scratchblocks] tag :\
Last edited by MathlyCat (July 14, 2015 18:38:47)
- DaSpudLord
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
No support, except the workaround should probably look something like this instead-
reset timer
repeat until <<(timer) > []> or <(timer) = []>
...
end
- stickfiregames
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
This sticky rejected it.Is that sticky actually a “do not suggest” list now?
Still no support because the workaround is easy.
- rollercoasterfan
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
Well, kind of, but it's really just a list of commonly suggested block workarounds.This sticky rejected it.Is that sticky actually a “do not suggest” list now?
Anyway, no support, because of the simple workaround I listed in that link up there.
- Pixar2000
- Scratcher
100+ posts
"Repeat for ___ secs" blocks
I think that it can be made by - I think there should be repeat blocks that don't repeat a given number of times, but for a given number of seconds.
How it works is, there's a repeat block like this:repeat (for ___ seconds?)
end
Then you enter how many seconds you want it to repeat.
Please give feedback
define repeat (How much) for (time) secs
repeat (How much)
...::grey//Put anything here.
end
wait (time::custom-arg) secs
stop [this script v]
- Austinato
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
Another workaround: It can be worked around:repeat until <(timer) = [?]>Or you can use a variable, if you have another spite that uses the timer.
move () steps
end
when green flag clickedx is how many seconds you want it to wait, reflecting off of the “wait for 1 secs” at the end of the script.
repeat (x)
script
wait (1) secs
end
- VideoGamerCanInvent
- Scratcher
1000+ posts
"Repeat for ___ secs" blocks
Semi-Support cause of an easy workaround.
- Pixar2000
- Scratcher
100+ posts
"Repeat for ___ secs" blocks
How will he watch TV if he can't turn it on?
- Discussion Forums
- » Suggestions
- » "Repeat for ___ secs" blocks