Discuss Scratch

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:

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) = [?]>

move () steps
end
Or you can use a variable, if you have another spite that uses the timer.

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.

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

cobraguy wrote:

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.
fixed xD

No support. Easy workaroud.
mathfreak231
Scratcher
1000+ posts

"Repeat for ___ secs" blocks

Repeat for a Set Amount of Time

The Scratch Wiki; made by Scratchers, for Scratchers
DevanWolf
Scratcher
100+ posts

"Repeat for ___ secs" blocks

repeat(1)secs::control cstart
RPFluffy
Scratcher
1000+ posts

"Repeat for ___ secs" blocks

jh1234l wrote:

It can be worked around:
repeat until <(timer) = [?]>

move () steps
end
Or you can use a variable, if you have another spite that uses the timer.

cobraguy wrote:

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?
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

MegaApuTurkUltra wrote:

RPFluffy wrote:

jh1234l wrote:

It can be worked around:
repeat until <(timer) = [?]>

move () steps
end
Or you can use a variable, if you have another spite that uses the timer.

cobraguy wrote:

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.
No support as per the workaround
^^^

DevanWolf wrote:

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)

scrooge200
Scratcher
1000+ posts

"Repeat for ___ secs" blocks

This sticky rejected it.
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

scrooge200 wrote:

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

stickfiregames wrote:

scrooge200 wrote:

This sticky rejected it.
Is that sticky actually a “do not suggest” list now?
Well, kind of, but it's really just a list of commonly suggested block workarounds.

Anyway, no support, because of the simple workaround I listed in that link up there.
Pixar2000
Scratcher
100+ posts

"Repeat for ___ secs" blocks

anguz110 wrote:

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

I think that it can be made by -
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

jh1234l wrote:

It can be worked around:
repeat until <(timer) = [?]>

move () steps
end
Or you can use a variable, if you have another spite that uses the timer.
Another workaround:
when green flag clicked
repeat (x)
script
wait (1) secs
end
x is how many seconds you want it to wait, reflecting off of the “wait for 1 secs” at the end of the script.
Pixar2000
Scratcher
100+ posts

"Repeat for ___ secs" blocks

Not
<[] = []>
It would be
<[] > []>
anguz110
Scratcher
46 posts

"Repeat for ___ secs" blocks

This thread should be dead.
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?

Powered by DjangoBB