If I receive What's you name
Say bob
Offline
Using your example:
When gf clicked forever ask [What would you like to ask?] and wait if <(answer) = [What's your name?]> say [Bob] for [2] secs end endIf you want to have it answering lots of questions then one solution would be to nest the if else blocks:
When gf clicked forever ask [What would you like to ask?] and wait if <(answer) = [What's your name?]> say [Bob] for [2] secs else if <(answer) = [Are you real?]> say [I think, therefore I am.] for [2] secs else if <(answer) = [What are you?]> say [Can't you tell?] for [2] secs else end end end endA more elegant solution would be to use two lists. One called questions and one called answers.
When gf clicked forever ask [What would you like to ask?] and wait set (counter) to [0] repeat until <<(answer) = <item (counter) of [Questions v]>> or <(counter) = <length of [Questions v]>>> change [counter v] by [1] if <(answer) = <item (counter) of [Questions v]>> say <item (counter) of [Answers v]> for [2] secs end end end
Last edited by Smozzick (2012-03-02 11:57:38)
Offline
Smozzick wrote:
Using your example:
When gf clicked forever ask [What would you like to ask?] and wait if <(answer) = [What's your name?]> say [Bob] for [2] secs end endIf you want to have it answering lots of questions then one solution would be to nest the if else blocks:When gf clicked forever ask [What would you like to ask?] and wait if <(answer) = [What's your name?]> say [Bob] for [2] secs else if <(answer) = [Are you real?]> say [I think, therefore I am.] for [2] secs else if <(answer) = [What are you?]> say [Can't you tell?] for [2] secs else end end end endA more elegant solution would be to use two lists. One called questions and one called answers.
Then have a script something like this:When gf clicked forever ask [What would you like to ask?] and wait set (counter) to [0] repeat until <<(answer) = <item (counter) of [Questions v]>> or <(counter) = <length of [Questions v]>>> change [counter v] by [1] if <(answer) = <item (counter) of [Questions v]>> say <item (counter) of [Answers v]> for [2] secs end end end
Thank you for those
Offline