|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Fri Mar 18, 2016 10:39 pm
yesno question |
Is there a way to force the yesno to timeout?
What I want to do is be presented with a box with 2 options, either A) end the box/clear/do nothing, or B) if nothing happens after say 10 seconds, the box executes a command on it's own then clears the box. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Mar 18, 2016 11:55 pm |
Yes, but it is very tricky and I think the box will still be displayed after you expire the script that asked the question. You have to spawn 2 threads and have your main script wait on them. You have to place the yesno or pick in its own thread with its return information placed in a variable. The variable is emptied prior to executing the yesno or pick. The second thread runs a simple timer and kills the yesno/pick thread when the time runs out. Since the yesno/pick thread will cease to exist when the question is answered the main thread need only watch for the yesno thread to end and then can check the variable. If the variable is empty it does the default response. The commands you need to look at are #THREAD, #WAITTHREAD, #STOP, and #WAIT.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Sat Mar 19, 2016 12:10 am |
Thanks. I'll look into this :)
|
|
|
|
|
|