Discuss Scratch

chocolatepenguin
Scratcher
1000+ posts

Boolean "When I Recieve" block

I think there should be a block, like “When I Recieve” but a boolean. It would work like this (replace mouse down? with the boolean)
when flag clicked
forever
wait until mouse down?
stamp
end
The block would go in the control tab.
chocolatepenguin

Last edited by chocolatepenguin (May 11, 2013 18:29:15)


ImagineIt
Scratcher
1000+ posts

Boolean "When I Recieve" block

This has been suggested multiple times, and the fact is, it's not even really possible as a broadcast is only a millisecond or so long.
xlk
Scratcher
100+ posts

Boolean "When I Recieve" block

ImagineIt wrote:

a broadcast is only a millisecond or so long.
it's instant, when a message is broadcasted, it checks for “when I receive …”s.

radu4000
Scratcher
53 posts

Boolean "When I Recieve" block

there is a way to do this! however, its not really good working. the trick: make a variable. let's say you broadcasted “start”. then, make the variable called: “start received?”. in the stage, put the scripts ( the “//” means a comment):
when gf clicked
set (start received?) to (false) // You write “false”, not put a boolean that reports “false”

Then, put this script:
when I receive (start)
set (start received?) to (true) // You write “true”, not put a boolean that reports “true”
wait (0.5) secs
set (start received?) to (false)

Let's say that a sprite rotates until it receives “start”.
Put this script in the sprite:
when gf clicked
repeat until < ((start received?) = (true)) >
turn clockwise 15 degrees
end

YOU GOT IT!!

Wanna laugh? This should to it!
Wanna pop some bubbles? Bubbles!
Wanna be a slime? Get slimy!
Wanna find out something? Did ya know…
Wanna see an epic video? MWAHAHA
Wanna die? No URL cuz you don't!

LUUUULZ
15-MinuteGaming
Scratcher
100+ posts

Boolean "When I Recieve" block

A Boolean broadcast is a rejected suggestion. However, Wait until broadcast and Repeat until broadcast are not rejected and you can find the thread discussing them here.

My kumquats and forum signatures ate each other. Luckily, I did not like any of them anyways.
The evil kumquat must have some relation with thanos cat. Evil kumquat is 2.0 and thanos cat is 3.0
April 1st is this Saturday. Details here.
Za-Chary
Scratcher
1000+ posts

Boolean "When I Recieve" block

Yep, this is rejected. Also seeing how this topic is now 6 years old, I should probably close it.

Za-Chary wrote:

1.1 “Broadcast received” boolean block
Some users want a block that looks like the block below, referencing broadcasts. But, there is a lot of ambiguity on how this would work. Would it return true if the broadcast was fired since the project was created, since the green flag was clicked, or since something else was broadcasted? The workaround is simple: use variables that change when a broadcast is received, then use the “equals” block.

However, the blocks “repeat until broadcast received” and “wait until broadcast received” are NOT rejected; you can discuss them on this post.

<[message v] received? :: events>

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.

I was a Scratch Team member from May 10th 2019 to October 29th 2021.

my notebook | scratch team essay | accessibility essay

Powered by DjangoBB