
I am looking for a little help to finish off this script. The script as it is works, however, I want it to speak the sum of the 2 numbers. I have tried a few different ways but I can't get it. Hey, I pretty proud of getting this far with it. I've made a comment in the code of what I want it to say.Code:
:start
$heard = "speech"
WaitForChange($heard)
if($Heard = "won")
$x = 1
Say("one")
elseif($heard="two")
$x = 2
Say("two")
endif
WaitForChange($heard)
if($heard = "plus one")
$y = 1
Say("plus one")
elseif($heard = "plus two")
$y = 2
Say("plus two")
#print($x + $y)
EndIf
WaitForChange($heard)
if($heard = "what does that equal")
#This is where I want it to say something like "$x plus $y equals the sum" or
for example "1 plus 2 equals 3" (if those were the numbers it heard)
print($x + $y)
Endif
GoTo(start)
As always any help is appreciated,
Thanks
Code:
Code:
Abs is the math function and you can do basic math with it like add, subtract, multiple and divide.
@JustinRatliff Thanks that worked. I was so close once.
@Richard R Thanks, Ya I have to put what you suggested in the script. I'm building it step by step, there's lots more to go in to it.
Code:
Doesn't like the "x" in there.
What symbols should I use for multiplication and division.
Thanks
I get this when I run it;
Code:
this example limits the answer to 1 to 10 for her age.
Code:
This is very interactive an she has a blast playing this with the robot.
I will modifiy this soon as we have sayezbwait()
houston5913@hotmail.com.
Thanks
Bob
Thanks
Check the EZ-Script manual for the syntax and explanation of the GetRandom() command, it explains how to use it.