Author Topic: Creating a trigger button  (Read 1550 times)

Kram_R

  • Newbie
  • *
  • Posts: 2
Creating a trigger button
« on: September 24, 2020, 02:34:53 PM »
Hi,

Need to create a trigger that continues to fire after I say "fire" and stop firing when I say "cease fire".
I'm sure there is a simple solution that I am missing. The "Press Key" says it will press and hold the key but it only presses it once. If I check the "Press continuously until stopped" it does keep repeating but won't stop no matter what I do unless I stop the command. I added a screenshot to help illustrate my problem.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Creating a trigger button
« Reply #1 on: September 24, 2020, 10:02:49 PM »
Simplest would probably be to use two commands, E.G.
fire
Code: [Select]
Press ? key and hold for 0,01 seconds and release
Pause 0,05 seconds
with the "Repeating" option set to "Repeat continuously until stopped"

cease fire
Code: [Select]
Kill command, 'fire'
Release ? key


If you're looking to trigger the command using another keyboard key, you can use a single command with a loop instead, E.G.
Code: [Select]
Start Loop While :  Keyboard Key 'F12' Is Pressed
End Loop
Start Loop While :  Keyboard Key 'F12' Is Not Pressed
    Press ? key and hold for 0,01 seconds and release
    Pause 0,05 seconds
End Loop

The first loop makes sure the trigger key is released before starting the second loop, so the latter doesn't stop immediately.

Kram_R

  • Newbie
  • *
  • Posts: 2
Re: Creating a trigger button
« Reply #2 on: September 25, 2020, 04:28:43 AM »
I'm sure one of these solutions will work. Thanks, I'll give them a try.