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

#1 2013-03-11 12:49:40

vijer
New Scratcher
Registered: 2013-03-05
Posts: 2

Ask and Wait .. but not indefinitely

Is there a way to set an ask block to wait a set time instead of indefinitely?

Something like,

ask "What is 2 / 36 ?" wait 15 seconds.

Offline

 

#2 2013-03-11 15:12:59

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Ask and Wait .. but not indefinitely

Well yes, there is a method. This one works if you haven't used any ask blocks yet:


when gf clicked
set [Answered? v] to (1)
broadcast [Broadcast v]
wait (5) secs//The wait.
if <(answer) = []>//This is a blank.
 set [Answered? v] to (0)
 broadcast [Broadcast v]
end
when I receive [Broadcast v]
if <(Answered?) = (1)>
 ask [What do you want to say?] and wait
end

Now, if (Answered?) equals 1, then that means that they answered you, but if it equals 0, then that means they didn't.

Also, if you need to use this more then one time, or need to use it after other wait blocks, then just ask me for the other script seeing as this won't work in those situations.  wink

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer