Any way to get opponent input from fighting game?

Ask gaming related questions (AHK v1.1 and older)
cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Any way to get opponent input from fighting game?

Post by cyrexsef » 22 May 2022, 07:31

Hello my question is if there is any way to get the opponent input in a fighting game. I.E. when they press back key

T.i.a

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Any way to get opponent input from fighting game?

Post by mikeyww » 22 May 2022, 07:59

I am often proven wrong, but my impression is that AHK cannot infiltrate your game program and determine what input has been received there.

cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Re: Any way to get opponent input from fighting game?

Post by cyrexsef » 22 May 2022, 09:36

mikeyww wrote:
22 May 2022, 07:59
I am often proven wrong, but my impression is that AHK cannot infiltrate your game program and determine what input has been received there.
So there's no way to 'auto block' or 'auto jump' on opponent input in ahk?

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Any way to get opponent input from fighting game?

Post by mikeyww » 22 May 2022, 10:10

There could be a way if you identify something that could be a an indicator of "opponent input", such as something that changes on the screen. AHK can identify pixel colors and images. You might want to have a peek at the documentation, in case it generates some ideas.

cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Re: Any way to get opponent input from fighting game?

Post by cyrexsef » 22 May 2022, 11:32

mikeyww wrote:
22 May 2022, 10:10
There could be a way if you identify something that could be a an indicator of "opponent input", such as something that changes on the screen. AHK can identify pixel colors and images. You might want to have a peek at the documentation, in case it generates some ideas.
Okay thanks. On a separate note in the fighting game it self there's one button say x when I press x once it does one hit but when I press it again it does another hit (like a combo) . Is there a way I can make my script do a combo on one button press but then if I press it another time it stops that combo then if I press it again it starts the combo from first hit?

Any help is appreciated

cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Re: Any way to get opponent input from fighting game?

Post by cyrexsef » 22 May 2022, 11:41

mikeyww wrote:
22 May 2022, 10:10
There could be a way if you identify something that could be a an indicator of "opponent input", such as something that changes on the screen. AHK can identify pixel colors and images. You might want to have a peek at the documentation, in case it generates some ideas.
Okay thank you, on a new note. Is there a way for me to like for my script to start a combo sequence like punch1 punch2 punch3 on d button press But when i press d second time it stops it completely but then when I pr3ss third time it starts again with punch 1

Pls any help is appreciated greatly

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Any way to get opponent input from fighting game?

Post by mikeyww » 22 May 2022, 12:25

Code: Select all

d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::SendInput % punch ? "punch1punch2punch3" : ""

cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Re: Any way to get opponent input from fighting game?

Post by cyrexsef » 22 May 2022, 12:31

mikeyww wrote:
22 May 2022, 12:25

Code: Select all

d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::SendInput % punch ? "punch1punch2punch3" : ""
Punch is just a variable correct? Punch1punch2punch3 are the button inputs correct? So will it work like this?

d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::SendInput % punch ? "Send {s down}{u down}, {s up}{u up},{d down}{d up}" : ""

Is that how it will work?

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Any way to get opponent input from fighting game?

Post by mikeyww » 22 May 2022, 12:37

Yes. Try:

Code: Select all

d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::Send % punch ? "{s down}u{s up}d" : ""

cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Re: Any way to get opponent input from fighting game?

Post by cyrexsef » 22 May 2022, 19:11

mikeyww wrote:
22 May 2022, 12:37
Yes. Try:

Code: Select all

d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::Send % punch ? "{s down}u{s up}d" : ""
so in notepad its working, but in the game its not doing anything

what im using

Code: Select all


z::SetTimer, z Up, % (punch := !punch) ? 50 : "Off"
z Up::Send % punch ?  "{s down}u{s up}d"  : ""
not sure why

cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Re: Any way to get opponent input from fighting game?

Post by cyrexsef » 22 May 2022, 19:22

cyrexsef wrote:
22 May 2022, 19:11
mikeyww wrote:
22 May 2022, 12:37
Yes. Try:

Code: Select all

d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::Send % punch ? "{s down}u{s up}d" : ""
so in notepad its working, but in the game its not doing anything

what im using

Code: Select all


z::SetTimer, z Up, % (punch := !punch) ? 50 : "Off"
z Up::Send % punch ?  "{s down}u{s up}d"  : ""
not sure why
I even tried to put sleep ::


JOY5::SetTimer, JOY5 Up, % (punch := !punch) ? 50 : "Off"
JOY5 Up::Send % punch ? "send, {s down}, sleep 50, send {s up}" : ""

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Any way to get opponent input from fighting game?

Post by mikeyww » 22 May 2022, 19:29

Try running as admin. Also see notes here about key delays & other factors. viewtopic.php?f=7&t=11084

Code: Select all

If !A_IsAdmin && !(DllCall("GetCommandLine", "str") ~= " /restart(?!\S)") {
 Try Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
 ExitApp
}
d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::
SetKeyDelay,, 25
Send % punch ? "{s down}u{s up}d" : ""
Return
There are no guarantees!

cyrexsef
Posts: 25
Joined: 12 Mar 2022, 16:19

Re: Any way to get opponent input from fighting game?

Post by cyrexsef » 23 May 2022, 12:47

mikeyww wrote:
22 May 2022, 19:29
Try running as admin. Also see notes here about key delays & other factors. viewtopic.php?f=7&t=11084

Code: Select all

If !A_IsAdmin && !(DllCall("GetCommandLine", "str") ~= " /restart(?!\S)") {
 Try Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
 ExitApp
}
d::SetTimer, d Up, % (punch := !punch) ? 50 : "Off"
d Up::
SetKeyDelay,, 25
Send % punch ? "{s down}u{s up}d" : ""
Return
There are no guarantees!
can you please explain what the extra u d in Send % punch ? "{s down}u{s up}d" : ""

is for?

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Any way to get opponent input from fighting game?

Post by mikeyww » 23 May 2022, 12:50

It isn't extra. d is (nearly or sometimes) the same as{d down}{d up}.

Post Reply

Return to “Gaming Help (v1)”