Rafiki Front Bumber icon Rafiki Front Bumber Rafiki front bumper plugin: reads 4 proximity sensors via serial, updates ARC variables, blocks motor movement toward detected obstacles for SLAM Try it →
 

Waitforuserinput

UI.waitForUserInput(timeout, prompt)

Parameters

timeout Time to wait in seconds before stopping waiting for their text input.
prompt The text prompt to display to the user while waiting for their text input

Returns

The lowercase text entered by the user, or the word timeout.

Description

Suspends execution of the script and prompts the user to enter text or a timeout occurs after timeout seconds. If a timeout occurs, the method will return "timeout."

*Note: the returned string is in lowercase



Example

// Wait for any input from the user
response = UI.waitForUserInput(30, "Type anything to me");

print("You entered: " + response);