Author Topic: entering information command  (Read 6589 times)

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
entering information command
« on: May 16, 2019, 02:11:31 PM »
I am trying to create a command the will enter the following information in the order listed. I want to beable to say the name and number listed after "scout"

16/5 20:01
pam.scout Biliri 0 0 0

I have the below working so far but the rest I am stuck. any suggestions or references would be helpful.
Thanks

Set date [scouting date time] value to the current date/time (UTC)
Quick Input, '{DATEDAY:scouting date time}'
Press / ? key and hold for 0.1 seconds and release
Quick Input, '{DATEMONTHNUMERIC:scouting date time}'
Press Space key and hold for 0.1 seconds and release
Quick Input, '{TIME:scouting date time}'
Press Enter key and hold for 0.1 seconds and release
Quick Input, 'pam.scout'
Press Space key and hold for 0.1 seconds and release

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #1 on: May 16, 2019, 02:42:34 PM »
Is this name something predefined (I.E. something you can pick out of a list), or arbitrary?

If it can be listed, I'd suggest using the "Wait For Spoken Response" action, instead of putting it all in one command phrase. Otherswise, with the addition of three numbers from 0-9, you'll have 1000 command phrases for each name added.

E.G.
Code: [Select]
Set date [scouting date time] value to the current date/time (UTC)
Set Text [~datetimeformat] to 'd/M hh:mm'

Wait for spoken response: 'Biliri;other name'
Play sound, 'C:\Windows\media\ding.wav'
Wait for spoken response: '[0..9]'
Play sound, 'C:\Windows\media\ding.wav'
Wait for spoken response: '[0..9]'
Play sound, 'C:\Windows\media\ding.wav'
Wait for spoken response: '[0..9]'

Quick Input, '{DATETIMEFORMAT:scouting date time:~datetimeformat}[ENTER]pam.scout {TXT:~name} {TXT:~firstNumber} {TXT:~secondNumber} {TXT:~thirdNumber}'

I'm using a text value to format the datetime value's output, the parameters for that can be found here.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #2 on: May 16, 2019, 03:04:54 PM »
thanks I will give it a try

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #3 on: May 16, 2019, 07:12:21 PM »
I'm sorry I missed the question the information is arbitrary
Name and 3 seperate numbers
and where would the wait for spoken response be found in VA

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #4 on: May 16, 2019, 07:43:08 PM »
Do the numbers have an arbitrary amount of digits as well?

For the name (and the numbers, if the answer to the above question is affirmative), you'll have to use dictation:
Code: [Select]
Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : [{DICTATION}] Equals ''
End Loop
Stop Dictation Mode
Set Text [~name] to '{DICTATION}'

Now, chances are you'll find the accuracy isn't great; Only thing you can do is train your speech recognition profile as best you can, and speak clearly.
If you're trying to dictate names, you'll probably also come across ones that aren't in the dictionary, meaning you have to add them manually before they'll be recognized.


where would the wait for spoken response be found in VA
"Other >", "Advanced", "Get User Input", "Wait For Spoken Response"

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #5 on: May 16, 2019, 09:05:46 PM »
there are a possible 80 names so if dictation doesn't do it typing it in may be the way.
The numbers are 0..999 for each of the number categories and if I remember correctly VA will enter numbers below 1000.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #6 on: May 16, 2019, 09:48:21 PM »
You'll have to use dictation for numbers that large ("Wait For Spoken Response" is limited to 250 possible phrases, for performance reasons).

Because of that, you'll also need to convert from written numbers for the first ten ("zero"-"nine"), making the command look something like this:
Code: [Select]
Set date [scouting date time] value to the current date/time (UTC)
Set Text [~datetimeformat] to 'dd/M hh:mm'

Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : [{DICTATION}] Equals ''
End Loop
Stop Dictation Mode
Set Text [~name] to '{DICTATION}'

Start Loop : Repeat From 1 to 3
    Play sound, 'C:\Windows\media\ding.wav'
    Start Dictation Mode (Clearing Dictation Buffer)
    Start Loop While : [{DICTATION}] Equals ''
    End Loop
    Stop Dictation Mode
    Begin Text Compare : [{DICTATION}] Contains 'One'
        Set Text [~number{INT:~loopCount}] to '1'
    Else If Text Compare : [{DICTATION}] Contains 'Two'
        Set Text [~number{INT:~loopCount}] to '2'
    Else If Text Compare : [{DICTATION}] Contains 'Three'
        Set Text [~number{INT:~loopCount}] to '3'
    Else If Text Compare : [{DICTATION}] Contains 'Four'
        Set Text [~number{INT:~loopCount}] to '4'
    Else If Text Compare : [{DICTATION}] Contains 'Five'
        Set Text [~number{INT:~loopCount}] to '5'
    Else If Text Compare : [{DICTATION}] Contains 'Six'
        Set Text [~number{INT:~loopCount}] to '6'
    Else If Text Compare : [{DICTATION}] Contains 'Seven'
        Set Text [~number{INT:~loopCount}] to '7'
    Else If Text Compare : [{DICTATION}] Contains 'Eight'
        Set Text [~number{INT:~loopCount}] to '8'
    Else If Text Compare : [{DICTATION}] Contains 'Nine'
        Set Text [~number{INT:~loopCount}] to '9'
    Else If Text Compare : [{DICTATION}] Contains 'Zero'
        Set Text [~number{INT:~loopCount}] to '0'
    Else
        Set Text [~number{INT:~loopCount}] to '{TXTNUM:"{DICTATION}"}'
    End Condition
End Loop

Quick Input, '{DATETIMEFORMAT:scouting date time:~datetimeformat} pam.scout {TXT:~name} {TXT:~number1} {TXT:~number2} {TXT:~number3}'

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #7 on: May 18, 2019, 08:16:08 PM »
I have followed the example you provided, but it keeps saying number not set for all three. It does capture the name.
I have gone over the code a dozen times and can't see anything wrong. Clearly I am missing something.
I attached the VAP to see someone can spot what I am doing wrong.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #8 on: May 18, 2019, 08:44:28 PM »
You need to actually set "~loopCount". Enter that variable name into the Start Loop window's "Indexer Name" field, so it writes the current count to it.

Looks perfect otherwise :)

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #9 on: May 20, 2019, 12:26:31 PM »
First thanks for all the help creating this command.
I have found a script that will get the system name out of my game journals.
The script was done in AutoHotKey
I am not sure how to best incorporate it into my VA command
Any suggestion would be great
Thanks

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #10 on: May 20, 2019, 03:55:15 PM »
As "MonitorSystem.exe" is presumably the compiled version of that script, you can run it, wait for it to exit, then read the contents of the file it outputs into a variable.

E.G.
Code: [Select]
Run application 'MonitorSystem.exe' - wait until it completes
Set Text [~name] to [Systemname.log]

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #11 on: May 20, 2019, 06:30:29 PM »
The way this exe seem to work is to be running in the back ground, and polling the last jump information and putting it into the systemname.log. the log changes on every jump and will not update with the notepad open. when it is opened it only displays one name.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #12 on: May 20, 2019, 06:37:57 PM »
In that case that file should always contain the latest info, no?

So you only need
Code: [Select]
Set Text [~name] to [Systemname.log]

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #13 on: May 20, 2019, 06:46:35 PM »
yes it always has the current information.
when I run the script you gave me it inputs systemname.log not the contents of that log.
Clearly I am missing something that I forgot to add to make it read the file

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #14 on: May 20, 2019, 07:18:32 PM »
Are you using the "Value from file/URI" option of the "Set a Text Value" action?

You want to enter a path to that file in there.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #15 on: May 20, 2019, 07:24:21 PM »
At least someone reads the whole list of options, clearly I don't
Thanks that worked.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #16 on: May 24, 2019, 08:38:24 PM »
In the above commands, it loops 3 times for 3 different sequences of numbers, is there a way to have say something for each of the 3 sequences.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #17 on: May 25, 2019, 09:24:32 AM »
Can you clarify "have say something"?

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #18 on: May 25, 2019, 10:09:18 AM »
The command loops 3 time to collect data to print out, I want to it to say for each loop what needs to go in that number sequence.
ie, 1.merits stolen 2. cargo stolen 3. percentage undermined


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: entering information command
« Reply #19 on: May 25, 2019, 10:35:41 AM »
You could replace
Code: [Select]
Play sound, 'C:\Windows\media\ding.wav'

with something like
Code: [Select]
    Begin Integer Compare : [~loopCount] Equals 1
        Say, 'merits stolen'
    Else If Integer Compare : [~loopCount] Equals 2
        Say, 'cargo stolen'
    Else
        Say, 'percentage undermined'
    End Condition

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: entering information command
« Reply #20 on: May 26, 2019, 11:17:44 AM »
Thank you for all your help it work fantastically.