
Dunning-Kruger
Canada
Asked
— Edited
Here is a little project I have been working on with fellow forum member Bob Houston.... It was originally written by another forum member Louis Vazquez.... who really did a good job on this... I have tweaked it a little to try and make it more adaptable from project to project.... It works like sound servo, but using text to drive the servo instead of sound....
I have Luis' permission to post so here it is...
I have posted it to the cloud as well...
Make a script that is called to handle the function of evaluating the text. This one does that.
In your other scripts, set the $sent = "whatever you want to say"
Then
Call this script.
You could also use waitforchange on the $sent.... The draw back is you couldn't say the same phrase twice in a row.....
would be changed to if you are using the Script Manager which I would recommend.
[edit] The WaitForChange($Sent) would need to be added to the Text Speech Engine. As soon as it got done speaking or maybe just before, you could $Sent = "" so that the script would have time to evaluate what it needs to before the variable is set to "" again.
This would allow you to just use
$sent = "What you want to say" instead of SAYEZB( "What you want to say" )
you would need to put the Text Speech Engine in a loop and call it at the start of the project in an init or startup script.
Good point Rich and Richard.
@Richard Unless you have the $sent variable "reset" to something immediately after waitforchange
Ok... I figured a repeatuntil loop in the speech engine (to keep it running) could be used and a waitforchange right after the repeatuntil command...