Author Topic: SOLVED Thanks ---- Repeating event command script  (Read 4965 times)

D.D.Harriman

  • Guest
SOLVED Thanks ---- Repeating event command script
« on: April 12, 2018, 03:21:08 PM »
Ok,
Background. GeForce Experience has become broken so I have switched to OBS Studio and LightScreen.
I have VA set up to start/stop the OBS Recording and take screen shots with Lightscreen.
Problem is that in Elite Dangerous GeFe showed notifications when I was recording or when I took a screen shot and I really miss those notifications.

Lightscreen is supposed to have a built in sound alert when it takes a shot but it doesn't work. This is an easy one for me as I can simply make a sound file and add it to the VA command that executes the screen shot.

OBS is proving to be more difficult. I have several support requests out to various places hoping to find a device that has an led that I can control from VA so the light comes on when I am recording and goes out when not recording. If anyone knows of such an indicator box I would like the information. The one I currently think might work is the Genovations CP-48 keypad which supposedly has a programmable led but so far I haven't heard back from them.

In the interim I am thinking having a repeating low volume "beep/tone" on a 10-15 second timer that toggles when I toggle the recorder on and off. Recorder on, it beeps/tones then repeats the beep/tone to remind me that the recorder is running. I can record the beep/tone but how would I write the macro??
« Last Edit: April 14, 2018, 10:36:41 AM by D.D.Harriman »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4790
  • RTFM
Re: Repeating event command script
« Reply #1 on: April 12, 2018, 03:59:23 PM »
This is an option:
Code: [Select]
Press Right Ctrl+R keys and hold for 0,02 seconds and release
Begin Boolean Compare : [recording] Equals True
    Set Boolean [recording] to False
Else
    Set Boolean [recording] to True
End Condition - Exit when condition met
Set date [~nextSound] to [~nextSound] plus [10] seconds
Start Loop While : [recording] Equals True
    Begin Date Compare : [~nextSound] Is Less Than Or Equals Current Date/Time
        Play sound, '{VA_SOUNDS}\Recording Beep.wav'  (and wait until it completes)
        Set date [~nextSound] to [~nextSound] plus [10] seconds
    End Condition
End Loop

When the command is triggered, it will press the key combination to stop or start recording(I'm assuming it's the same for both, otherwise you can add different keypresses to the condition instead), and if the loop isn't running it will set the variable to the running state and start the loop.
If the loop is already running, the variable will be set to the stopped state and the command will exit.
The command running the loop will stop the loop and exit.

There is something to consider here: I have the "Wait until sound completes before continuing command" option checked, which means that if you stop and start recording at the same time the sound is playing, two loops will run, and two sounds will play.

You can disable this option, but it will mean the 10 second delay will instead be 10 seconds minus the length of the sound; Pick your proverbial poison.


For the indicator light, if you're familiar with Arduino at all, you could buy a cheap clone, attach an LED(or use the internal one, if applicable), and control it via serial using an inline function. It's not as slick as something off the shelf, but you can't beat the price(and the API is pretty simple, which may not be true for a complete commercial product).


Do keep in mind that the above examples will be non-synchronized, meaning the VoiceAttack recording state and the actual OBS recording state can differ if a keypress doesn't go through(This is true for any solution relying on one-way communication, of course).

D.D.Harriman

  • Guest
Re: Repeating event command script
« Reply #2 on: April 12, 2018, 04:19:01 PM »
What gives.?  Cannot copy and paste anymore??

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Repeating event command script
« Reply #3 on: April 12, 2018, 05:10:59 PM »
What are you trying to copy and paste?

D.D.Harriman

  • Guest
Re: Repeating event command script
« Reply #4 on: April 12, 2018, 07:06:10 PM »
The posted script.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Repeating event command script
« Reply #5 on: April 12, 2018, 08:37:51 PM »
There's nothing restricting that from this site.  You'll want to click the, 'select' link and then right-click and choose, 'copy'.  If none of that is working for you, you'll want to either try clearing your browser cache or try a different browser.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4790
  • RTFM
Re: Repeating event command script
« Reply #6 on: April 13, 2018, 02:21:04 AM »
Copying actions to text is one-way only, you can't import plain text into VoiceAttack.

There should be enough information in the text to build a working command, but I've attached a .vap that you can import directly.

D.D.Harriman

  • Guest
Re: Repeating event command script
« Reply #7 on: April 14, 2018, 09:59:14 AM »
Thank you Pfeil

I have it working as a voice command and that is set to also work with the keyboard input.

BUT, I now realize I errored in my original request.

I need it to toggle.

I toggle the video recorder on/off with the F12 key. I added this script to that script as an EXECUTE ANOTHER COMMAND and the sound does play on the ~10 interval as I want, but, even when I toggle the recorder off, the sound keeps playing.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4790
  • RTFM
Re: Repeating event command script
« Reply #8 on: April 14, 2018, 10:26:36 AM »
even when I toggle the recorder off, the sound keeps playing.
As in it plays till the end of the sound file, or it still plays every 10 seconds?

The command should toggle itself when executed, that's what it's set up to do.

You can add some feedback to the command so you know what's happening in the background:
Code: [Select]
Begin Boolean Compare : [recording] Equals True
    Set Boolean [recording] to False
    Write '[Orange] Recording stopped' to log
Else
    Set Boolean [recording] to True
    Write '[Green] Recording started' to log
End Condition - Exit when condition met
Set date [~nextSound] to [~nextSound] plus [10] seconds
Start Loop While : [recording] Equals True
    Begin Date Compare : [~nextSound] Is Less Than Or Equals Current Date/Time
        Play sound, '{VA_SOUNDS}\Recording Beep.mp3'  (and wait until it completes)
        Set date [~nextSound] to [~nextSound] plus [10] seconds
    End Condition
End Loop
Write '[Blue] Loop ends' to log

D.D.Harriman

  • Guest
Re: Repeating event command script
« Reply #9 on: April 14, 2018, 10:35:45 AM »
Ahh Yes!! It does toggle. I mixed myself up by modifying the script to play the sound file immediately so I would know the recording had started. Since I use the same voice command, the sound plays again and I just didn't wait long enough to find out that the script had indeed toggled off.

 

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4790
  • RTFM
Re: SOLVED Thanks ---- Repeating event command script
« Reply #10 on: April 14, 2018, 11:00:45 AM »
If you want the sound to play immediately, the only modification you need to make is to remove the first
Code: [Select]
Set date [~nextSound] to [~nextSound] plus [10] secondsaction.

It should then play when you toggle recording on, but not when you toggle it off.


If you want distinct stop and/or start sounds, those would go where the first two "Write a Value to the Event Log" actions are in my previous post.