Author Topic: IL-2 BOX and VA - Chat Bar  (Read 2406 times)

AH_Hollywood

  • Newbie
  • *
  • Posts: 7
IL-2 BOX and VA - Chat Bar
« on: April 12, 2020, 10:12:04 AM »
Hello Pfeil et al,

Truly enjoying my VA, and trying my best to learn how to do all this. I continue to read the manual and the tips that Pfeil provides.. one day, I think I'll get it beyond the easy and basic ones.

I am asking if there is an easier way to do the following...

I fly IL-2 BOX in VR and I can't see nor type on the keyboard.. VA, is perfect to solve this problem..

In game to Chat will friendly side, the key to open chat is "enter" and to send chat to friendly side is "CTRL + Enter"

I read up on Clipboard and using buffers..   Is there an easier to set up what I have in place?

Additionally, I only have a pause set up until the "Stop Dictation" is engaged.. is there a way to trigger the end of comms with a keystroke or command? I figure Boolean loop would be a start.. 

Here is my flow:

Quote
Pause 1 second
Say, 'Friendly Comms, Copy'  (and wait until it completes)
Press Enter key and hold for 0.5 seconds and release
Clear the Windows clipboard
Start Dictation Mode (Clearing Dictation Buffer)
Say, 'buffer cleared'
Pause 10 seconds
Set Windows clipboard to ' {DICTATION}'
Stop Dictation Mode
Pause 1 second
Press Left Ctrl+V keys and hold for 0.5 seconds and release
Pause 1.5 seconds
Press Right Ctrl+Enter keys and hold for 0.5 seconds and release

Any guidance is greatly appreciated.

S!

HW

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: IL-2 BOX and VA - Chat Bar
« Reply #1 on: April 12, 2020, 11:07:19 AM »
There's no need to explicitly clear the clipboard, as you're overwriting the contents anyway.


To wait for a keypress, you can use an empty loop:
Code: [Select]
Start Loop While :  Keyboard Key 'Enter' Is Not Pressed
End Loop
You could potentially do away with the enter keypress action, and just have your physical keystroke open the chat window instead.

If you want to make sure your keystroke doesn't interfere with pasting, you could use another loop to wait for it to be released before proceeding, E.G.
Code: [Select]
Start Loop While :  Keyboard Key 'Enter' Is Not Pressed
End Loop
Start Loop While :  Keyboard Key 'Enter' Is Pressed
End Loop


To end dictation using speech, you can do something like
Code: [Select]
Start Dictation Mode (Clearing Dictation Buffer)
Wait for spoken response: 'dictation complete'
Stop Dictation Mode

Recognized commands and/or responses are not added to the dictation buffer, so you don't need to worry about them getting typed accidentally (assuming you pick a phrase that is recognized reliably).


Another option is to try and detect when you have finished speaking, as outlined here.

AH_Hollywood

  • Newbie
  • *
  • Posts: 7
Re: IL-2 BOX and VA - Chat Bar
« Reply #2 on: April 25, 2020, 10:01:30 AM »
Hello again Pfeil,

I appreciate your help with my last request.

I seem to be having issues with Clipboard

Quote
Clear the Windows clipboard
This command does not seem to clear the clipboard.

I am running as administrator.

I am leaving the field blank as described..

when I run my script, it is pasting "dictations" from prior stored clipboard data.

I searched the internet and there isn't much on clipboard out there.

Any ideas?


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: IL-2 BOX and VA - Chat Bar
« Reply #3 on: April 25, 2020, 10:10:10 AM »
Putting text into and/or clearing the clipboard is a basic API method; Have you verified data remains in the clipboard between "Set a Text Value to the Windows Clipboard" actions (E.G. using the "Write a Value to the Event Log" action with the "{CLIP}" token)?

What does your command look like (I.E. what's in the action list)?

AH_Hollywood

  • Newbie
  • *
  • Posts: 7
Re: IL-2 BOX and VA - Chat Bar
« Reply #4 on: April 25, 2020, 12:44:48 PM »
Hello Sir,

I am able to view the clipboard by using Win+V and can see data in there..

Here is the script:
Quote
Clear the Windows clipboard
Set Windows clipboard to ' {DICTATION}'
Say, 'Go for Red Chat'
Press Enter key and hold for 2 seconds and release
Start Dictation Mode (Clearing Dictation Buffer)
Wait for spoken response: 'transmit'
Stop Dictation Mode
Pause 2 seconds
Press Left Ctrl+V keys and hold for 0.5 seconds and release
Pause 2 seconds
Press Right Ctrl+Enter keys and hold for 0.5 seconds and release

"Enter" opens the chat bar in IL-2 BOS and "RCTL+Enter" sends to friendly only.

As for the first line - Clear windows clipboard.. this is what appears if I wish to edit
I thought this needs to be blank in order to clear clipboard.


Quote
Have you verified data remains in the clipboard between "Set a Text Value to the Windows Clipboard" actions (E.G. using the "Write a Value to the Event Log" action with the "{CLIP}" token)?

I am not certain I understand what you are asking above.
As I enact the script, I can see the dictation in the clipboard, but when I "send it", it copies the prior record clipboard data.. If I repeat the process, then it provides the most recent data..  make sense?


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: IL-2 BOX and VA - Chat Bar
« Reply #5 on: April 25, 2020, 12:50:54 PM »
Clear the Windows clipboard
Set Windows clipboard to ' {DICTATION}'
Say, 'Go for Red Chat'
Press Enter key and hold for 2 seconds and release
Start Dictation Mode (Clearing Dictation Buffer)

You're clearing the clipboard, then immediately setting it to the value of "{DICTATION}" again, before dictation actually starts (which is where you clear the buffer).

So you're both getting old data into the clipboard, while not getting the new data in.


You need to move the
Code: [Select]
Set Windows clipboard to ' {DICTATION}'action to below the "Stop Dictation Mode" action for this command to work correctly.

AH_Hollywood

  • Newbie
  • *
  • Posts: 7
Re: IL-2 BOX and VA - Chat Bar
« Reply #6 on: April 25, 2020, 12:56:44 PM »
Awesome.. thank you !!!

I will give that a try.

AH_Hollywood

  • Newbie
  • *
  • Posts: 7
Re: IL-2 BOX and VA - Chat Bar
« Reply #7 on: April 25, 2020, 01:10:40 PM »
MAGIC!!!!  ;) ;) ;)

wazooda

  • Newbie
  • *
  • Posts: 2
Re: IL-2 BOX and VA - Chat Bar
« Reply #8 on: May 12, 2020, 12:13:38 AM »
MAGIC!!!!  ;) ;) ;)

Is this working for you? I too fly MP IL-2 in VR and can't easily access a keyboard.

I'm a newbie to VA, so if you could post your script so I can use/modify it I would greatly appreciate it.

Thanks!