Wait for event in custom block?

I don't know

exactly.

There is not that much to do
Just click
AskTout script pic (7)

then you see a prompt. After 3 seconds default value (55) will be reported or any entered value.

Mostly by accident, for script started as tell>>launch - "stop other scripts in sprite" works exactly as expected while "tell'ed" partially acts for the current sprite.

There is a project to test this behavior:Snap! Build Your Own Blocks
There are 3 parallel scripts started by broadcast and "launch". You can test "stop" variants to see which sprite is affected.

@bh, I encountered a bug. When I run my script, stop this block stops the rest of the script as well. And when I answered the question w/ my block, Snap! refused to continue let me run my script. It just... stoped working.

Could you post the project link? (I know you probably did earlier, but I'd rather no reread 46 messages to find it!) Thanks.

Here:
https://snap.berkeley.edu/snap/snap.html#present:Username=joecooldoo&ProjectName=Timed%20Ask%20Block

If you click the flag and answer it before time is out, it happens. but when you click stop, it returns to normal. Before stopping it though you will see that there is one process still running for some reason.

I'm a little confused because I don't see a STOP THIS BLOCK anywhere in either of your ASK blocks (reporter and command).

But also, if you're going to test it by asking the same question repeatedly, you shouldn't use ANSWER ≠ remembered-answer as the completion test. :~)

My bad, its STOP OTHER SCRIPTS IN SPRITE.

@cinnapoca, I finished the block: Timed Ask Block
Will report true if answered. Will report false if not answered or is the same answer as last question.

@joecooldoo... Thanks for doing this! I tried the block on a repeated question HERE, but for me it does some weird delays. I think it has to do with the last answer being the same, which for my app, may occur.

timed_ask

I know it may also have to do with the issue that bh is checking on.

@dardoro, your solution does work. I put the same test code into your project and shared it HERE. I will use that as a workaround until bh and team have time to look at the issues outlined earlier. Thanks again!

My block reports true and false, not letters :~) Use the answer block. Did you figure out the graphical part of the question?

@bh another bug, same project, try putting a say block in the else part of the if condition.

If your project already requires JS, this patch to "stop other..." may be used: Snap! 6.9.0 Build Your Own Blocks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.