Author Topic: Simple Macro  (Read 4048 times)

datalore44

  • Guest
Simple Macro
« on: July 19, 2017, 03:51:17 PM »
Hi.
I know this is simple but it is still to complicated for me at the moment!
I am new to voiceattack so I am not sure what to do.
I want to create a Battlefield 1 spotting macro.

1. press and release "q" key
2. wait 1.2 seconds
3. repeat

Many thanks
Alan

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4747
  • RTFM
Re: Simple Macro
« Reply #1 on: July 19, 2017, 04:27:40 PM »
You can use the "This command repeats continuously" option at the bottom right at the "Add/Edit a Command" window; This will mean the command runs until you stop all commands or close VoiceAttack.

Alternatively, you can set up a command that will toggle itself:
Code: [Select]
Begin Boolean Compare : [spotting] Equals False
    Write '[Green] Spotting' to log
    Set Boolean [spotting] to True
    Start Loop While : [spotting] Equals True
        Press Q key and hold for 0.06 seconds and release
        Pause 1.2 seconds
    End Loop
Else
    Set Boolean [spotting] to False
    Write '[Red] Spotting stopped' to log
End Condition

I've attached the latter command so you can import it.

datalore44

  • Guest
Re: Simple Macro
« Reply #2 on: July 19, 2017, 04:38:50 PM »
Thank you.
I was using the "this command repeats continuously option" but that did not have the desired effect as I needed the pause of 1.2 seconds between key presses.
I will try your code and see how it goes.
Alan.

datalore44

  • Guest
Re: Simple Macro
« Reply #3 on: July 19, 2017, 04:53:33 PM »
Thank you so much. Works like a charm.
All the best.