toggle to hold.... sort of

Ask gaming related questions (AHK v1.1 and older)
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

toggle to hold.... sort of

12 Nov 2018, 13:57

I am unable to search for answers, as I really don't know how to phrase the question. This is what I got:

Medal of Honor: 2010 has a dual-function crouch key.
Tap "a" and character crouches
Tap "a" or "space" and character stands up
HOLD "a" and character crouches momentarily and then lays down into a prone position
Tap "space" and character stands up

My goal would be hold the "a" key indefinitely and character remains crouched position... let go and stands up again
-----------------------------------------------------------------------------------------------------------
a::
Send {p down}<-------------------------------------------------------------;mapped crouch to "p"
KeyWait, a<-------------------------------------------------------------;hoped this would stop continue to prone, but does not
Send {p up}
-----------------------------------------------------------------------------------------------------------
This code works in some similar circumstances, but not in this one :(

:morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
Rohwedder
Posts: 7629
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: toggle to hold.... sort of

14 Nov 2018, 02:12

Hallo,
untested, try:

Code: Select all

$a:: ;User holds "a"
Send, a ;Script taps "a" and character crouches
KeyWait, a ;Script waits until the user releases "a"
Send, {Space} ;Script taps "Space" and character stands up
Return
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

Re: toggle to hold.... sort of

14 Nov 2018, 10:32

Thank you :)
... but didn't work :(

I have been messing with it and appears to be one of those games that has "hard coded" functions and no amount of scripting can
change that.

I like the script though, so I will keep it on hand and looks like I will be able to apply it somewhere else :thumbup:

Many thanks, :morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: toggle to hold.... sort of

14 Nov 2018, 11:43

~a Up::Send, {Space}
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

Re: toggle to hold.... sort of

14 Nov 2018, 13:19

Hey, Xtra.... I like your idea, but unfortunately the character continues to drop to prone when the key is held down. So
I want the game to "think" that I have let go of the key after character crouches, but before continuing to prone position.

Looking back at it now, I think my description in initial post could have been better.....

Tap "a" and release.... character crouches
Tap "a" and release again.... character stands back up
Hold "a" for 2 seconds and character pauses at crouch for a fraction of a second and continues down to prone
Tap "space" and release.... character gets off his belly to standing position

With that said, I tried your idea, but it needs more code. Now with a better understanding of what needs to happen, can you add to this script?

Thanks, :morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 82 guests