This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-04-27 12:08:39

Tornier
New Scratcher
Registered: 2011-04-27
Posts: 11

Question: Wait Block and broadcast

Hello!

Can you use a Wait Block and a Broadcastblock like this?:

[blocks] <when I receive[test]>
<wait(2)secsc>
<broadcast[another test]>

Such a code doesn't work for me.

Does anyone know how to use a Wait Block with a "When I receive"-Block?

Offline

 

#2 2011-04-27 12:15:28

Tornier
New Scratcher
Registered: 2011-04-27
Posts: 11

Re: Question: Wait Block and broadcast

Hello!

Can you use a Wait Block and a Broadcastblock like this?:

[block]
<when I receive[ something
<wait(2)>
<broadcast[ something
[/block]

Such a code doesn't work for me.

Does anyone know how to use a Wait Block with a "When I receive"-Block?


Sry for dobblepost! I didn't found an Edit Button

Offline

 

#3 2011-04-27 13:22:49

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Question: Wait Block and broadcast

Sorry, New Scratchers cannot edit their posts.

What you did should work, and induce recursionhmm

Offline

 

#4 2011-04-27 14:00:49

Tornier
New Scratcher
Registered: 2011-04-27
Posts: 11

Re: Question: Wait Block and broadcast

hmm it didnt work, i didnt know why, but i found a solution.
I replaced the
<when I recive>
with an
<wait until [something=1]>

Instead of using the broadcast command I set the variable 'something* = 1.

I think it was a logical problem in my whole program.

Offline

 

#5 2011-04-27 19:11:15

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Question: Wait Block and broadcast

Perhaps whatever broadcasted "test" was doing so repeatedly, causing the script to start over before the 2 seconds were up and therefore never broadcasting "another test".


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

Board footer