Submission Number: 84
Submission ID: 78
Submission UUID: 61aea2b6-1c50-4a4a-9c3f-5589ccb2397c
Submission URI: /Script

Created: Wed, 05/06/2020 - 12:54
Completed: Wed, 05/06/2020 - 12:54
Changed: Mon, 05/11/2020 - 14:13

Remote IP address: 50.35.82.111
Submitted by: Anonymous
Language: English

Is draft: No
Webform: Script
Submitted to: Script Upload

Script

Demo Guess Number Timeout
Neon will select a number between 1 and 10 at random and give hints until the user guesses correctly. If there is no response for 15 seconds, the script will exit
Script: "Demo Guess Number Timeout"
Author: Daniel McKnight
Timeout: 15
Description:
Neon will select a number between 1 and 10 at random
and give hints until the user guesses correctly. If there is no response for 15 seconds, the script will exit

Variable: numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Variable: neon_num = random(numbers)
Variable: user_guess = ""

Set: neon_num = random(numbers)
Neon speak:
# "My number is {neon_num}"
"I'm thinking of a number between 1 and 10"
"Guess what it is or say 'exit'"
LOOP guess
voice_input{user_guess}
if {user_guess} in {numbers}:
if {user_guess} == {neon_num}:
Neon speak: "You guessed it!"
Exit
if {user_guess} > {neon_num}:
Neon speak: "Lower"
LOOP guess END
if {user_guess} < {neon_num}:
Neon speak: "Higher"
LOOP guess END
else
if {user_guess} != "exit":
Neon speak:
"That's not a valid guess, try again."
LOOP guess END
Exit

Author

Daniel McKnight
{Empty}
{Empty}