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

#1 2012-03-13 18:48:44

sidthekoala
New Scratcher
Registered: 2012-03-06
Posts: 15

Broadcast stop script

Is there any way to use a broadcast to temporarily stop another script, for say 3 seconds, and then resume it?
Thanks for helping

Offline

 

#2 2012-03-13 19:51:11

PullJosh
Scratcher
Registered: 2011-08-01
Posts: 500+

Re: Broadcast stop script

Not that I know of, but you may need to ask an expert.


http://www.blocks.scratchr.org/API.php?action=text&string=I'm_on_vacation!&xpos=155&ypos=90&font_size=30&bgimage=http://imageshack.us/a/img339/7215/sspeechsigapiforwords.png

Offline

 

#3 2012-03-13 19:54:11

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Broadcast stop script

There's a way, but it's a bad habit: Have a broadcast receiver, and have it set a timer. Have another script:

forever
repeat until <not<(time) = [0]>>
do stuff
end
wait until <(time) = [0]>
end

Last edited by bobbybee (2012-03-13 19:54:31)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#4 2012-03-13 20:48:56

turkey3
Scratcher
Registered: 2011-12-04
Posts: 500+

Re: Broadcast stop script

bobbybee wrote:

There's a way, but it's a bad habit: Have a broadcast receiver, and have it set a timer. Have another script:

forever
repeat until <not<(time) = [0]>>
do stuff
end
wait until <(time) = [0]>
end

This would work well

Offline

 

#5 2012-03-14 08:34:37

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

Re: Broadcast stop script

I would use this:

set [running? v] to [1]
forever if <(running?) = [1]>
do stuff

when I receive [pause v]
set [running? v] to [0]
wait (3) secs
set [running? v] to [1]

Offline

 

Board footer