Discuss Scratch

Supreme_Scratcher
Scratcher
26 posts

Repeat until message received block

I think it would be cool if there was a block that let you run or stop a script when a message has been broadcasted.

For example:

when green flag clicked
repeat until <message1>
move (10) steps
end



באַקאָן און געעקס און שטאָפּן

Geeks and bacon and stuff
Jerboas1224
Scratcher
100+ posts

Repeat until message received block

Would it be
<message [ v] received? :: events>
If it is, it's rejected…

Sorry, you have to wait 120 seconds between posts.
Supreme_Scratcher
Scratcher
26 posts

Repeat until message received block

Jerboas1224 wrote:

Would it be
<message [ v] received? :: events>
If it is, it's rejected…
Wait…………………………………… I can't find this anywhere in my events section…………………….





באַקאָן און געעקס און שטאָפּן

Geeks and bacon and stuff
Jerboas1224
Scratcher
100+ posts

Repeat until message received block

Supreme_Scratcher wrote:

Jerboas1224 wrote:

Would it be
<message [ v] received? :: events>
If it is, it's rejected…
Wait…………………………………… I can't find this anywhere in my events section…………………….


It's not in the editor, it's possible to color the blocks on the forums.

Sorry, you have to wait 120 seconds between posts.
Sheep_maker
Scratcher
1000+ posts

Repeat until message received block

Duplicate

Jerboas1224 wrote:

Would it be
<message [ v] received? :: events>
If it is, it's rejected…
Not necessarily! That block was rejected due to its ambiguity in if(-else) blocks, but it'd work perfectly in wait and repeat until blocks. In fact, they're typically why the block is suggested in the first place.

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
TheRealNetherBefore
Scratcher
1000+ posts

Repeat until message received block

There's a pretty easy workaround for this.
when I receive [message 1 v]
set [message v] to [1]
when green flag clicked
repeat until <(message) = [1]>
ysh
end

*Drinks ketchup*
there is no ethical consumption under capitalism my dudes
Small Games | Tips and Advice | Boredom Cat | Misc
Want to make a fantasy world everyone on scratch can use? Click here!
G'thorpax the Unspoken
Botcho_Otkho
Scratcher
1000+ posts

Repeat until message received block

You could use variables instead of messages. No support.

I see now that the circumstances of one's birth are irrelevant. It is what you do with the gift of life that determines who you are. - Mewtwo
Paddle2See
Scratch Team
1000+ posts

Repeat until message received block

Sheep_maker wrote:

Duplicate

Jerboas1224 wrote:

Would it be
<message [ v] received? :: events>
If it is, it's rejected…
Not necessarily! That block was rejected due to its ambiguity in if(-else) blocks, but it'd work perfectly in wait and repeat until blocks. In fact, they're typically why the block is suggested in the first place.
Thanks for the link! It does look like this is a duplicate topic so I'll close it to keep the conversation all in one place.

Please use the existing topic in the link above.

Scratch Team Member, kayak and pickleball enthusiast, cat caregiver.

This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.
(credit to Za-Chary)



;

Powered by DjangoBB