Difference between revisions of "ISKernel:WaitFor (Command)"
Jump to navigation
Jump to search
(2 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
== Description == | == Description == | ||
+ | <small>WaitFor can only be used within a script.</small> | ||
+ | |||
+ | WaitFor is generally used to wait for one of several responses, through the [[ISSession:Triggers_%28Service%29|triggers service]], to an action. Script execution is paused until one of the responses is found, or the specified timeout interval elapses. WaitFor will use each possible response given as a case sensitive search string. If no timeout is given, the default is 5 seconds. The [[ISSession:WaitFor_%28Top-Level_Object%29|WaitFor Top-Level Object]] is then used to determine the result of the command. | ||
== Examples == | == Examples == | ||
+ | *Example 1 | ||
+ | Press N | ||
+ | WaitFor "You don't have one" "You drank the" | ||
+ | Switch ${WaitFor} | ||
+ | { | ||
+ | case 0: | ||
+ | echo "WaitFor Timed out" | ||
+ | break | ||
+ | case 1: | ||
+ | echo "I didn't have one!" | ||
+ | break | ||
+ | case 2: | ||
+ | echo "Phew, I drank it" | ||
+ | break | ||
+ | } | ||
+ | EndSwitch | ||
== See Also == | == See Also == | ||
*[[LavishScript:Commands|LavishScript Commands]] | *[[LavishScript:Commands|LavishScript Commands]] | ||
+ | *[[IS:Kernel#Commands|Kernel Commands]] | ||
*[[IS:Session#Commands|Inner Space Session Commands]] | *[[IS:Session#Commands|Inner Space Session Commands]] | ||
+ | |||
{{Command-Stub}} | {{Command-Stub}} | ||
+ | [[Category:Inner Space]] | ||
+ | [[Category:Inner Space Kernel]] | ||
+ | [[Category:Inner Space Kernel Commands]] |
Latest revision as of 04:25, 19 October 2005
Contents
Syntax
WaitFor | |
Usage | Intermediate |
Level of Understanding | Intermediate |
Computer Savvy | Intermediate |
Logic | Intermediate |
WaitFor <up to 20 things> [max wait in tenths of seconds]
Description
WaitFor can only be used within a script.
WaitFor is generally used to wait for one of several responses, through the triggers service, to an action. Script execution is paused until one of the responses is found, or the specified timeout interval elapses. WaitFor will use each possible response given as a case sensitive search string. If no timeout is given, the default is 5 seconds. The WaitFor Top-Level Object is then used to determine the result of the command.
Examples
- Example 1
Press N WaitFor "You don't have one" "You drank the" Switch ${WaitFor} { case 0: echo "WaitFor Timed out" break case 1: echo "I didn't have one!" break case 2: echo "Phew, I drank it" break } EndSwitch
See Also