Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Need a script that autofires when gamepad button held down


  • Please log in to reply
4 replies to this topic
Sentry5567
  • Members
  • 3 posts
  • Last active: Feb 22 2012 07:28 PM
  • Joined: 22 Feb 2012
I know that AHK has an autofire function, and I've done Google searches but I can't seem to find anything that would do this.

I need a script that will set autofire (or just repeat the button once every second or two) if I hold a gamepad button down. I used the script to find my gamepad button mapping and the button I want is Joy3. Has anyone made a script that does this, or knows how? Everything I try doesn't work at all. :(

Thanks in advance!

Edit: I found this in the Definitive Autofire Thread and modified it, but all this does is send the word Joy3 as text. I need to send a response from joystick button 3 when it's held down.

$Joy3::
While GetKeyState("Joy3","p"){
Send Joy3
Sleep 2000
}
return

Sentry5567
  • Members
  • 3 posts
  • Last active: Feb 22 2012 07:28 PM
  • Joined: 22 Feb 2012
Tried this but no luck. What am I doing wrong?

$Joy3::
While GetKeyState("Joy3"){
send, {joy3}
Sleep 2000
}
return

Ohnitiel
  • Members
  • 755 posts
  • Last active: Sep 08 2016 06:26 PM
  • Joined: 25 Aug 2011

Tried this but no luck. What am I doing wrong?

$Joy3::
While GetKeyState("Joy3"){
send, {joy3}
Sleep 2000
}
return


Are you sure that the button you are pressing is Joy3 for Autohotkey?

To help determine the button numbers for your joystick, use this test script. Note that hotkey prefix symbols such as ^ (control) and + (shift) are not supported (though GetKeyState can be used as a substitute). Also note that the pressing of joystick buttons always "passes through" to the active window if that window is designed to detect the pressing of joystick buttons.



Sentry5567
  • Members
  • 3 posts
  • Last active: Feb 22 2012 07:28 PM
  • Joined: 22 Feb 2012

Tried this but no luck. What am I doing wrong?

$Joy3::
While GetKeyState("Joy3"){
send, {joy3}
Sleep 2000
}
return


Are you sure that the button you are pressing is Joy3 for Autohotkey?

To help determine the button numbers for your joystick, use this test script. Note that hotkey prefix symbols such as ^ (control) and + (shift) are not supported (though GetKeyState can be used as a substitute). Also note that the pressing of joystick buttons always "passes through" to the active window if that window is designed to detect the pressing of joystick buttons.



Absolutely sure. If I use the script in my first post when I press Joy3 it will type out the words "Joy3" in the active window, and if I hold it down it does it every 2 seconds. So I know it's recognizing the button press, I just need to know what command to use to send Joy3 pressed down to the active window :)

Edit: To add to this I played around and tried Send {Enter} in the script, and when I hold down Joy3 it presses the Enter key. The script is recognizing that the button is held down, I just need some magic here to make that command press Joy3 over and over!

HikariWS
  • Members
  • 2 posts
  • Last active: May 07 2016 03:16 PM
  • Joined: 09 Feb 2014

Any luck on this?

 

I tested it and [[send, {ENTER}]] works. But as tutorial says, [[send, {Joy3}]] doesn't.

 

How can we send joystick/gamepad strokes?