Author Topic: How do you assign a spoken number to a INT variable?  (Read 7332 times)

JLX

  • Guest
How do you assign a spoken number to a INT variable?
« on: October 23, 2016, 04:52:42 PM »
Here is what I'm doing so far:

Command: Set Number*

Actions:
  • Write 'CMD_AFTER is: {CMD_AFTER}' to log
  • Set integer [TestNum] value to the converted value of {CMD_AFTER} (save value to profile)
  • Write 'Variable TestNum is: {INT:TestNum}' to log
  • Say, 'Last number was {CMD_AFTER}'

Event Log:
  • 6:32:13 PM - Variable TestNum is: Not set
  • 6:32:13 PM - Integer token could not be converted : {CMD_AFTER}
  • 6:32:13 PM - CMD_AFTER is: 19
  • 6:32:13 PM - Recognized : 'set number 19'
  • (Text-To-Speach confirmation of CMD_AFTER value is also heard working correctly: "Last number was 12")

Why can't VoiceAttack convert "12" to 12 and store in TestNum? What am I doing wrong?

Any help would be appreciated. Tnx.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: How do you assign a spoken number to a INT variable?
« Reply #1 on: October 23, 2016, 05:10:42 PM »
Which VoiceAttack version are you using? What you described works fine for me.

JLX

  • Guest
Re: How do you assign a spoken number to a INT variable?
« Reply #2 on: October 23, 2016, 06:48:05 PM »
Silly of me to forget to post version info...

1.5.12.30 prerelease on Win10x64 as admin.

Is that the same version you're running?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: How do you assign a spoken number to a INT variable?
« Reply #3 on: October 23, 2016, 07:16:58 PM »
1.5.12.30 prerelease on Win10x64 as admin.
That's what I was afraid of.

All tokens are broken in v1.5.12.30. Use this unofficial build, or revert to v1.5.12.27.

Quote from: VoiceAttack.com
The best efforts will be made to make sure the beta works reasonably well before putting it out here, however, the guarantee is that there is no guarantee :)

Not sure why it worked when writing to the log, but either way, that version has issues.

JLX

  • Guest
Re: How do you assign a spoken number to a INT variable?
« Reply #4 on: October 23, 2016, 07:28:37 PM »
Tnx. Didn't see your other thread. I also ran in to the first issue you did (token to log printing the token string rather than contents) as well.

Don't think I'll bother with the unofficial and will roll back to .27

Appreciate your quick replies. Very helpful.

Thanks again.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: How do you assign a spoken number to a INT variable?
« Reply #5 on: October 23, 2016, 08:00:41 PM »
Within the next 20 minutes I should have a new beta out with all that straightened out.

JLX

  • Guest
Re: How do you assign a spoken number to a INT variable?
« Reply #6 on: October 23, 2016, 08:57:21 PM »
Sounds good, Gary.

I just ran into another issue with variables/tokens on .27

My understanding is that all variables are global. However, I'm unable to use an INT variable I've set in one command when calling from another (in this case the second command is actually called by the first).

I'm just testing functionality at the moment but basicallly what I'm doing is:
  • Using initial commands (as shown earlier in the thread) to set target INT values (e.g. A_target = 7)
  • After the variable is set, the last action of the command calls another command which checks all current values and loops by inc/dec values (w/ key presses of course) until the current values == target values (e.g. A_current == A_target && B_current == B_target, etc.)

What I'm finding with my current test is that I can set A_target just fine now in .27. But, when I try and reference it from the SetCurrentValsToTargetVals followup command, my previously set A_target is reported as "not set".

Just a FYI as you're squishing these kinds of bugs.  Hope that was clear.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: How do you assign a spoken number to a INT variable?
« Reply #7 on: October 23, 2016, 09:02:37 PM »
Make sure you are dealing with all ints and not ints and small ints.  I know that sounds confusing, but I'd love to phase out small ints (used to be called conditions), but a lot depends on those sticking around.

JLX

  • Guest
Re: How do you assign a spoken number to a INT variable?
« Reply #8 on: October 23, 2016, 09:21:23 PM »
Apologies, my bad. Had an unnoticed space after {INT: in one case:

Code: [Select]
{INT:A_target} vs.
{INT: A_target}

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: How do you assign a spoken number to a INT variable?
« Reply #9 on: October 23, 2016, 10:04:39 PM »
Yeah... that will do it ;)