Gaming GTA

Ask gaming related questions (AHK v1.1 and older)
gigilal
Posts: 5
Joined: 10 Apr 2021, 07:11

Gaming GTA

14 Apr 2021, 05:09

Hi,

I need some help with a script or if someone have one already and want to share it.

Activation / deactivation script - when this color appears on my screen the script presses F

https://gyazo.com/ee5720d153702e9f8fdd9a0f04a6d5ca

Then waits 5 secounds and presses Key 2

If this colour appears on the screen https://gyazo.com/7022d5de16085aad6618ba7c58a7c8a0

I want to to press Key 1, wait 2 secounds and then press key 2

Loops untill I deactivate it.

Does someone have something like this?
Last edited by BoBo on 14 Apr 2021, 06:38, edited 2 times in total.
Reason: Moved to Gaming section. Fixed broken links.
User avatar
mikeyww
Posts: 27068
Joined: 09 Sep 2014, 18:38

Re: Gaming GTA

14 Apr 2021, 06:58

Code: Select all

F3::
SetTimer, Go, % (on := !on) ? 250 : "Off"
SoundBeep, 1000 + 500 * on
Return
Go:
CoordMode, Pixel
SoundBeep, 1700
search(0x16671D, "F", 5, 2), search(0x534EA5, 1, 2, 2)
Return

search(color, send1, seconds, send2) {
 PixelSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, %color%,, Fast
 If ErrorLevel
  Return
 SoundBeep, 900
 Send %send1%
 Sleep, 1000 * seconds
 Send %send2%
}
gigilal
Posts: 5
Joined: 10 Apr 2021, 07:11

Re: Gaming GTA

14 Apr 2021, 08:06

@mikeyww, thank you so much for this, so I get the beeping sound but nothing else is happening from the script once the colors show ingame. In Full screen or in windowed mode, or is there something I need to implement myself?

Its for Browser FiveM GTA V :)
User avatar
mikeyww
Posts: 27068
Joined: 09 Sep 2014, 18:38

Re: Gaming GTA

14 Apr 2021, 08:08

Does it work in Notepad, if you show the images alongside it while Notepad is active?
gigilal
Posts: 5
Joined: 10 Apr 2021, 07:11

Re: Gaming GTA

14 Apr 2021, 08:49

Yes in notepad it works...I also run the script as administrator

Ive tested some basic scripts aswell just to try and figure out

Code: Select all

^m::
SendInput t/lock

Numpad2::
SendInput t/e{enter}
And nothing happened with these two either.
User avatar
mikeyww
Posts: 27068
Joined: 09 Sep 2014, 18:38

Re: Gaming GTA

14 Apr 2021, 10:05

You demonstrated that the script works, but your game does not seem to respond as you expect. You could examine tips for games. Remember that Send will always send to the active window.

https://autohotkey.com/board/topic/111737-how-to-make-ahk-work-in-most-games-the-basics/
gigilal
Posts: 5
Joined: 10 Apr 2021, 07:11

Re: Gaming GTA

14 Apr 2021, 10:21

So bascially I got this to work

^m::
Send {t down} /e

So the Script you sent me which I really appriciated is it possible to change it with commands (When green is pixel) F down and F up - Key2 down and up ?

Same with when red color is detected Send Key1 down and up and key2 down and up ?

I dont see where to change that function in your script :S

Hope you could help :)
User avatar
mikeyww
Posts: 27068
Joined: 09 Sep 2014, 18:38

Re: Gaming GTA

14 Apr 2021, 10:36

An example is below, in case it helps.

Code: Select all

search(color, send1, seconds, send2) {
 PixelSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, %color%,, Fast
 If ErrorLevel
  Return
 SoundBeep, 900
 Send {%send1% down}
 Send {%send1% up}
 Sleep, 1000 * seconds
 Send {%send2% down}
 Send {%send2% up}
}
The effect here is probably just a prolonged key press that could alternatively be accomplished with SetKeyDelay-- but either method is OK.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: imbelicalcord, NssOne and 63 guests