Author Topic: Making Voice Attack ask you for further commands? How?  (Read 7832 times)

tulextreme

  • Guest
Making Voice Attack ask you for further commands? How?
« on: May 10, 2017, 08:41:48 PM »
Hello my name is cmdr tulextreme (ed player add me if ya want!:) and this is my first post here in va forums!
I've been using voice attack for about 6 months now with ED, and i must say it made the game experience 100x better!
The gamma of things you can accomplish with this software is really astonishing so i'm here on my first "how to" question seeking for more knowledge to improve my voice attack profile!
So i came up with this vlc radio commands that open vlc and all... i've made a "check" integer so when i dont have vlx loaded it warns me that "player is not open", also it says something if it is... check attached img1


What i would like to do and still cant figure out how it to when i asks to play a song and the vlc is not open, va would ask me if i want it to open the player, so if i return a simple "yes" it would set a small int condition to open the program by it self... attached check img2


Ive made a command with the knowledge i have but it asks if i want it to open the player but it just opens it automatically... check attached img3


Anyways i hope i made myself a bit clear and someone could help me out and accomplish this!
Thank you in advance for any tips i could get!
All the best to ya all!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4778
  • RTFM
Re: Making Voice Attack ask you for further commands? How?
« Reply #1 on: May 10, 2017, 09:19:23 PM »
You can use a loop to pause the command until you confirm:
Code: [Select]
Start Loop While : [confirmValue] Does Not Equal 2
End Loop
That would go where your "Begin Small Integer Compare" action is now. Also remove the "End Condition" action.


You can also add a timeout:
Code: [Select]
Set decimal [Timeout] value to the converted value of {DATETICKS}
Start Loop While : ([confirmValue] Does Not Equal 2 AND [{EXP: ({DATETICKS} - {DEC:Timeout}) > 100000000}] Equals '0')
End Loop
Begin Text Compare : [{EXP: ({DATETICKS} - {DEC:Timeout}) > 100000000}] Equals '1'
    Write '[Purple] Timed out' to log
Else
    Write '[Blue] Starting VLC' to log
End Condition
100000000 is 10 seconds, you can of course adjust this value to your preferences.

tulextreme

  • Guest
Re: Making Voice Attack ask you for further commands? How?
« Reply #2 on: May 11, 2017, 10:21:17 AM »
I appreciate your help and time, but all i could do is having VA endlessly repeat "would you like me to open music player now?" and loop the vlc.exe ...  ;D I'm too dumb for this i guess  :-\

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4778
  • RTFM
Re: Making Voice Attack ask you for further commands? How?
« Reply #3 on: May 11, 2017, 10:34:35 AM »
That's not supposed to happen, show me how you've set up the command.

tulextreme

  • Guest
Re: Making Voice Attack ask you for further commands? How?
« Reply #4 on: May 11, 2017, 11:22:22 AM »
Okay big thx!  Here's the ((OpenVLC)) cmd that would wait for my "yes" response and them launch vlc.exe


Thing is the > confirmValue token does not "link" the next cmd that would start vlc

Code: [Select]
Say, 'would you like me to open music player now?'  (and wait until it completes)
Start Loop While : [confirmValue] Has Been Set
    Execute command, 'start music player;open radio;Load music;open music player' (and wait until it completes)
End Loop

I cant understand how to link the 'yes' voice response which would state true and them trigger the next cmd with the exe launch... it's all too obscure to my knowledge atm... i'm looking for more va lectures online though...
Thank you once again Pfeil for your attention and help!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4778
  • RTFM
Re: Making Voice Attack ask you for further commands? How?
« Reply #5 on: May 11, 2017, 12:09:45 PM »
Code: [Select]
Say, 'would you like me to open music player now?'  (and wait until it completes)
Start Loop While : [confirmValue] Has Not Been Set
End Loop
Execute command, 'start music player;open radio;Load music;open music player' (and wait until it completes)
Set small int (condition) [confirmValue] value to [Not Set]
Should work

The loop idles while the value is not set, so the command only proceeds when the "Yes Please" command has executed and set it to something.


I've made an attempt to explain how the loop and other control flow actions operate, in this topic.

tulextreme

  • Guest
Re: Making Voice Attack ask you for further commands? How?
« Reply #6 on: May 11, 2017, 01:02:13 PM »
Pfeil ill study the link you posted now! As for the script it works but the whole cmd is processed, there's no wait for the 'yes please' trigger... VA states no music player is running them 'would like to open it' them it... opens it LOL!  ;D

Anyways this been a nice information exchange nonetheless! Thanks you once again!

Gangrel

  • Caffeine Fulled Mod
  • Global Moderator
  • Full Member
  • *****
  • Posts: 216
  • BORK FNORK BORD
Re: Making Voice Attack ask you for further commands? How?
« Reply #7 on: May 11, 2017, 01:13:59 PM »
Question: would you ask for a song to be played and say *no* to opening VLC?

Just curious, because with the exception of a false positive trigger of the command, I cannot think of a situation where I *would* do that.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4778
  • RTFM
Re: Making Voice Attack ask you for further commands? How?
« Reply #8 on: May 11, 2017, 01:42:55 PM »
the whole cmd is processed, there's no wait for the 'yes please' trigger
That should only happen if "confirmValue" has a value already. You can check whether this is the case by adding the following before the loop:
Code: [Select]
Write '[Purple] {SMALL:confirmValue}' to log
If that is the case, running the command a second time should have worked though, as it clears the value as the last action(in my example).

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Making Voice Attack ask you for further commands? How?
« Reply #9 on: May 12, 2017, 11:40:28 AM »
It sounds like you may already have your question answered, but I figured I'd chime in as well for good measure.

What you're describing (requesting input from the user and processing based on the feedback) is at the core of my Mass Effect 3 profile. Essentially the user must "teach" VA the state of the game in order for VA to be effective. For instance, how can VA allow the user to cast Shepard's powers if VA doesn't know Shepard's current powers or (more fundamentally) Shepard's class? I chose to do this through VA queries for user information.

I've described and provided example code (with associated profile snippet attached) for one of my ME3 functions that utilizes a user query in THIS POST. It uses principles that were previously described by the other folks on this thread. It's also more complicated than the example that Pfeil provided (though I'm sure Pfeil would have suggestions for how I could improve it and trim any fat :) ), but I was aiming for maximum flexibility for handling ALL query commands employed by my profile. Hopefully this helps!