Author Topic: aim wait for response fire (simplyfied) SOLVED  (Read 2659 times)

jane

  • Newbie
  • *
  • Posts: 49
aim wait for response fire (simplyfied) SOLVED
« on: March 04, 2024, 11:19:59 AM »
hello.
I try to figure out thepseudo code below. How does it look writing into Voice attack? Thank You for any help.
 
On command speaking "aim"
 press right mousebutton (start aim)
wait for spoken response NEXTCOMMAND
if NEXTCOMMAND = fire then {
click left mousebutton
click left mousebutton
click left mousebutton }
release right mousebutton
else
release right mousebutton
exit command
}
« Last Edit: March 04, 2024, 12:52:19 PM by jane »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4767
  • RTFM
Re: aim wait for response fire (simplyfied)
« Reply #1 on: March 04, 2024, 11:30:23 AM »
Which part are you having trouble with, specifically? That should translate almost directly to VoiceAttack actions


Placing the mouse button release at the bottom would do away with the "Else" branch.

Regardless, there is no need for an explicit command exit, as that'll happen when the bottom of the action list is reached anyway.

jane

  • Newbie
  • *
  • Posts: 49
Re: aim wait for response fire (simplyfied)
« Reply #2 on: March 04, 2024, 11:53:05 AM »
Which part are you having trouble with, specifically? That should translate almost directly to VoiceAttack actions


Placing the mouse button release at the bottom would do away with the "Else" branch.

Regardless, there is no need for an explicit command exit, as that'll happen when the bottom of the action list is reached anyway.

hello and thank You for suggestions.
In Va help doc I read example of executing a single action in the wait for spoken...

How would the code look executing several actions?
(3 x left mouseclicks)
)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4767
  • RTFM
Re: aim wait for response fire (simplyfied)
« Reply #3 on: March 04, 2024, 11:56:06 AM »
The "Wait For Spoken Response" doesn't execute any other actions by itself, you need to use a condition in addition to it.

Conditions can contain any number of actions.

jane

  • Newbie
  • *
  • Posts: 49
Re: aim wait for response fire (simplyfied)
« Reply #4 on: March 04, 2024, 11:59:50 AM »
The "Wait For Spoken Response" doesn't execute any other actions by itself, you need to use a condition in addition to it.

Conditions can contain any number of actions.
ah, thanks. Ill try using condition :)

jane

  • Newbie
  • *
  • Posts: 49
Re: aim wait for response fire (simplyfied)
« Reply #5 on: March 04, 2024, 12:49:43 PM »
this seemes to work.

Hold right mouse button down
Wait for spoken response: 'attack'
Begin Text Compare : [~textResult] Equals 'attack'
    Click left mouse button [duration 0,06 seconds]
    Pause 0,1 seconds
    Click left mouse button [duration 0,06 seconds]
    Pause 0,1 seconds
    Click left mouse button [duration 0,06 seconds]
    Pause 0,1 seconds
End Condition
Release right mouse button