"Repeat for ___ secs" blocks
id: 20841
category: Suggestions
posts: 194
anguz110
loading
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
loading
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
cobraguy
loading
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.
Firedrake969
loading
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.
mathfreak231
loading
DevanWolf
loading
repeat(1)secs::control cstart
RPFluffy
loading
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
loading
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
loading
repeat(1280)secs::control cstart
say(join[Bump #](timer))
MathlyCat
loading
^^^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 :\
scrooge200
loading
This sticky rejected it.
DaSpudLord
loading
No support, except the workaround should probably look something like this instead-
reset timer
repeat until <<(timer) > []> or <(timer) = []>
...
end
stickfiregames
loading
This sticky rejected it.Is that sticky actually a “do not suggest” list now?
Still no support because the workaround is easy.
rollercoasterfan
loading
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
loading
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
loading
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
Pixar2000
loading
Not
<[] = []>It would be
<[] > []>
anguz110
loading
This thread should be dead.
VideoGamerCanInvent
loading
Semi-Support cause of an easy workaround.
Pixar2000
loading
How will he watch TV if he can't turn it on?
anguz110
loading
Jfc this thread is almost 4 years old and it's been answered already, stop necrobumping
stickfiregames
loading
You're allowed to post on old suggestions if they haven't been implemented or rejected. Jfc this thread is almost 4 years old and it's been answered already, stop necrobumping
Anyway this block is ambiguous. If the time runs out halfway through the loop, would it cut off immediately or carry on to the end of the loop? The first might be more expected but it means you can't guarantee that every block in the loop will run the same number of times. The second would be more like the repeat until block.
Austinato
loading
Bumping.
tali1665
loading
Support!
repeat for (1) secs::control
Smurphy13AWESOME
loading
Sorry, no support. ST wants to make Scratch learning, only the essentials. Not to make it really easy. Good idea, but any block that's not adding a new thing, just making it easier shouldn't be added.
Auroura_Wolf
loading
Read the stickies. This has already been suggested, and already has a workaround. Now I suggest you close this topic
anguz110
loading
This thread is, like, 3 years old.
_-Unity-_
loading
that's nice. sometimes we need to control our timing and I think there should be repeat blocks that don't repeat a given number of times, but for a given number of seconds.this is what we need… Nice one!
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
cul8er
loading
??? Read the stickies. This has already been suggested, and already has a workaround. Now I suggest you close this topic
Where has it already been suggested? Which sticky?
As mentioned, there's a workaround and some ambiguity as to how it would work.
No support.
Sheep_maker
loading
This is the oldest repeat for _ secs block suggestion; this topic was probably posted on because their topic was closed for being a duplicate of this topic. Read the stickies. This has already been suggested, and already has a workaround. Now I suggest you close this topic
Pixar2000
loading
No. More like this.that's nice. sometimes we need to control our timing and I think there should be repeat blocks that don't repeat a given number of times, but for a given number of seconds.this is what we need… Nice one!
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
repeat for (1) secs{
}::control
Charles12310
loading
No Support. What if you are putting a script it the repeat seconds block and that one script takes more time than the amount of seconds you want? And if it does complete and the seconds are up, will it repeat again? No, it would repeat only once, since those seconds are up, and the script is done. Besides, what would happen to the script while the seconds are gone? Will they continue, or stop?
However, here is a good workaround:
However, here is a good workaround:
reset timer
repeat until <(timer) = (amount of seconds you want)>
... // Do Your Stuff Here
end
PkmnQ
loading
Fixed, and here's a workaround. 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{
. . .
} :: control
Then you enter how many seconds you want it to repeat.
Please give feedback
set [timer+ v] to ((timer) + (. . .))
repeat until <(timer) = (timer+)>
. . .
end
LionHeart70
loading
Semi support.. But there's a workaround. I could use this for an animation, though.
FancyFoxy
loading
I'd say I'd support this, as I would've needed this block for my animations and I'd assume, my games.
I'd is my favorite word now
I'd is my favorite word now
Botcho_Otkho
loading
removed by me because at this time i was kinda dumb
Charles12310
loading
It isn't rejected. There is nothing in the sticky. It's just that this block is complicated. Rejected from the sticky.
walkcycle
loading
That's a better workaround since the timer doesn't have to be reset. Fixed, and here's a workaround.set [timer+ v] to ((timer) + (. . .))
repeat until <(timer) = (timer+)>
. . .
end
Change the Boolean to
<(timer) > (timer+)> // greater than
so the loop is exited for sure.
Charles12310
loading
set [timer1 v] to ((timer) + (# of seconds))
repeat until <not <(timer) < (# of seconds)>>
...
end
What do you mean, exited? The timer doesn't have to be more than the amount of seconds otherwise it would repeat for the amount more than we want.
HappyMohid
loading
repeat <[] < []>
end
in scratch wiki
TheAdriCoolManDude
loading
No Support. It would cause problems, like this:
repeat for (2) seconds {
wait (20) secs
} :: control
ScratchDiogoh
loading
removed by ScatchDiogoh
Seam49
loading
Support, the workaround hardly ever works, and putting wait 20 seconds won't run at all, plus, if the time runs out in the middle, It just will skip the last bits, or at the top, well skip the whole thing, why, there are no reliable workarounds,
SickBoi2000
loading
Support!
I saw the soultions but i would make a custom block out of it.
I saw the soultions but i would make a custom block out of it.
PizzaAddict4Life
loading
(Removed by me)
Mr_PenguinAlex
loading
i support, would be useful in so many ways
the workaround is annoying and unreliable
the workaround is annoying and unreliable
SuperKamekArea
loading
No support, you are just making a seconds version of the repeat block, you can tell others to avoid turbo mode and you can set this:
... :: hatAlso, isn't this rejected?
repeat (() * (30))
...
end
...
Mr_PenguinAlex
loading
That's the point. No support, you are just making a seconds version of the repeat block,
That doesn't work. you can set this:... :: hat
repeat (() * (30))
...
end
...
It isn't rejected. Also, isn't this rejected?
DarthVader4Life
loading
I'm getting real sick and tired of people saying “No support, there's a workaround.” Very rarely does a block get removed because of a workaround. so rare in fact, that the only instance of a block getting removed because of a workaround that i am 100% sure happened is the forever if block. even then the extremely simple workaround wasn't the only factor, apparently users didn't understand it either. and because a block has a workaround DOESN'T mean it shouldn't be added. so if you could kindly read this, that'd be great.
cooldude-222
loading
Support!
I was about to suggest this! It would look like this:
I was about to suggest this! It would look like this:
repeat for (10) seconds {And work like this:
} ::control
set [time v] to (timer)
repeat until <(timer) > ((time) + [10])