Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Repeat until Sprite clicked or broadcast received
- amoorestl
-
Scratcher
18 posts
Repeat until Sprite clicked or broadcast received
I want one of my scripts to continue to do something until another script is clicked. The sprite that I want to wait on does broadcast a message when it is clicked. So, my question is, can I either detect another sprite being clicked and put that in a repeat until or repeat a group of commands until a broadcast message is received? If there's not a way to do this directly, can you think of a good “hack” to compete it?
Thanks.
Thanks.
- ShadowScizor
-
Scratcher
100+ posts
Repeat until Sprite clicked or broadcast received
I think of one way to do it which is to use variable
For the another sprite
set [stop? v] to [0 ]
repeat until <(stop?) = [1 ]>
end
For the another sprite
when this sprite clicked
set [stop? v] to [1 ]
Last edited by ShadowScizor (Nov. 14, 2014 02:51:11)
- Paigeri
-
Scratcher
500+ posts
Repeat until Sprite clicked or broadcast received
OOOOOOOFFFFPlease do not post unrelated comments or necropost. If you have a question, please create another thread.
- lwyay
-
Scratcher
10 posts
Repeat until Sprite clicked or broadcast received
I have the same problem, too
- lwyay
-
Scratcher
10 posts
Repeat until Sprite clicked or broadcast received
But I want it like, repeat something until broadcast is received, not clicked. Please help!





- 8bitjake
-
Scratcher
100+ posts
Repeat until Sprite clicked or broadcast received
I think of one way to do it which is to use variableset [stop? v] to [0 ]
repeat until <(stop?) = [1 ]>
end
For the another spritewhen this sprite clicked
set [stop? v] to [1 ]
But I want it like, repeat something until broadcast is received, not clicked. Please help!Just look at the 1st post in this message.
- lwyay
-
Scratcher
10 posts
Repeat until Sprite clicked or broadcast received
Thanks! I'll try itI think of one way to do it which is to use variableset [stop? v] to [0 ]
repeat until <(stop?) = [1 ]>
end
For the another spritewhen this sprite clicked
set [stop? v] to [1 ]But I want it like, repeat something until broadcast is received, not clicked. Please help!Just look at the 1st post in this message.
- lwyay
-
Scratcher
10 posts
Repeat until Sprite clicked or broadcast received
I mean I'd like it not to click the sprite? Like, automatically.I think of one way to do it which is to use variableset [stop? v] to [0 ]
repeat until <(stop?) = [1 ]>
end
For the another spritewhen this sprite clicked
set [stop? v] to [1 ]But I want it like, repeat something until broadcast is received, not clicked. Please help!Just look at the 1st post in this message.
- lwyay
-
Scratcher
10 posts
Repeat until Sprite clicked or broadcast received
Actually, I found another way supporting your way that worked, THANKS!
- 836562
-
Scratcher
1 post
Repeat until Sprite clicked or broadcast received
how can I make something that says repeat until not clicked







- deck26
-
Scratcher
1000+ posts
Repeat until Sprite clicked or broadcast received
how can I make something that says repeat until not clickedStart by creating a new topic and asking your question there please.
The answer will depend what's in the code within the loop. If it would be possible to click while other code is being run within the loop and it not be seen by the repeat until then the method shown above is still sensible.
- ded_PC
-
Scratcher
100+ posts
Repeat until Sprite clicked or broadcast received
how can I make something that says repeat until not clickedPlease do start your own thread but,
when green flag clicked
repeat until <>
<not <>><touching [(Insert rest of code here) v] ?>
end
- bmsarica
-
Scratcher
1 post
Repeat until Sprite clicked or broadcast received
i agree with @ShadowScizor
- benche1
-
Scratcher
100+ posts
Repeat until Sprite clicked or broadcast received
when green flag clicked
set [ variable] to [0]
repeat until <<(variable) = [1]> or <<touching [ mouse pointer] ?> and <mouse down?>>>
code
end
when I receive [ message]
set [ variable] to [1]
- Cabbagepult30
-
Scratcher
12 posts
Repeat until Sprite clicked or broadcast received
it like this
when green flag clicked
forever
change [ blank] by (1)
end
when this sprite clicked
stop [ Other scripts in this sprite]
- ca3045eis
-
Scratcher
1 post
Repeat until Sprite clicked or broadcast received
i really agree. this is terrible!!
- Astral_M4ku48
-
Scratcher
1 post
Repeat until Sprite clicked or broadcast received
when I receive [ blank]
set [any var] to [1]
when green flag clicked
repeat until <[any var] = [1]>
move (1) steps
end
You could do this
- Discussion Forums
- » Help with Scripts
-
» Repeat until Sprite clicked or broadcast received
