Author Topic: "saying" a "saved" word  (Read 3358 times)

quarrystile

  • Guest
"saying" a "saved" word
« on: June 16, 2018, 03:25:58 PM »
Sorry about the Subject title. I can't think of another way to describe it...

OK.. My question, and I will use fruit as an example

I want to set {FRUIT}= APPLE
I want to set {FRUIT}= BANANA
I want to set {FRUIT}= MANGO


VoiceAttack action.. "say something with "text to speech"...

Say " I would like a {FRUIT}

I hope this makes sense??



Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: "saying" a "saved" word
« Reply #1 on: June 16, 2018, 03:51:58 PM »
From your example it's not quite clear how you want to set this value and where you want to use it, but if you want to set a value with one spoken command, and retrieve it with another, something like this would work:

I want to set fruit equals [apple;banana;mango]
Code: [Select]
Set Text [FRUIT] to '{CMDSEGMENT:1}'

Which fruit would you like
Code: [Select]
Say, 'I would like a {TXT:FRUIT}'

There is a manual available detailing how the actions work, and which tokens are available; Press F1 while VoiceAttack has focus to open it.

quarrystile

  • Guest
Re: "saying" a "saved" word
« Reply #2 on: June 22, 2018, 02:28:38 PM »
Hi  Pfeil

Thanks for the reply.. Here is some more INFO to hopefully make it clearer...

Again, I will use Fruits as an example...

FIRST Pick a random fruit, using Random Interger ( THIS PART IS EASY )

IF 1 then [FRUIT]="APPLE"
IF 2 then [FRUIT]="BANANA"
IF 3 then [FRUIT]="ORANGE"
IF 4 then [FRUIT]="STRAWBERRY"
IF 5 then [FRUIT]="FISH ( OK, not a fruit LOL)

SO, random number is 3 .... so voiceAttack action.. "say something with "text to speech"...
Say " I would like a [FRUIT] 
Would say this.. I would like a ORANGE

SO, random number is 5 .... so voiceAttack action.. "say something with "text to speech"...
Say " I would like a [FRUIT] 
Would say this.. I would like a FISH


I am NOT saying the word into the Microphone (THE MICROPHONE is NOT used al all in this )


[FRUIT] = "THE ALIENS ARE COMING"

Say [FRUIT]

Does this help??

[FRUIT]="DOES THIS HELP"
voiceAttack action.. "say something with "text to speech"...
Say [FRUIT]


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: "saying" a "saved" word
« Reply #3 on: June 22, 2018, 04:24:06 PM »
It looks like you have all the components in your pseudocode already, practically it would look like this in VoiceAttack:
Code: [Select]
Set integer [rand] value as random from 1 to 5
Begin Integer Compare : [rand] Equals 1
    Set Text [FRUIT] to 'APPLE'
Else If Integer Compare : [rand] Equals 2
    Set Text [FRUIT] to 'BANANA'
Else If Integer Compare : [rand] Equals 3
    Set Text [FRUIT] to 'ORANGE'
Else If Integer Compare : [rand] Equals 4
    Set Text [FRUIT] to 'STRAWBERRY'
Else If Integer Compare : [rand] Equals 5
    Set Text [FRUIT] to 'FISH'
End Condition
Say, 'I would like a {TXT:FRUIT}'

quarrystile

  • Guest
Re: "saying" a "saved" word
« Reply #4 on: June 23, 2018, 12:54:18 PM »
OMG … Many thanks. I can not believe how close I was to actually getting it done all by myself.
I think I ended up with "tunnel vision" and could not see the wood for the trees LOL

So close but so far...  Many thanks

Time to RTFM  :P