0

AutoHotkey GTA 5 Macro Script Guide

This guide will show you how to use AutoHotkey to create and run macro scripts on GTA 5. Macros are assigned to hot keys. When you hit the hotkey, the macro will send a series of commands to your game to open your menu and automatically use items. This GTA 5 macro script will allow you to automatically eat snacks, put on armor,  and enable/disable passive mode. This will be a huge help to you and your team, by allowing you to stay alive in tricky missions and heists. As you probably know if you’re looking to setup macro hotkeys, the way the menu is set up in GTA 5 makes it almost impossible to play the game and apply health or armor simultaneously. This macro will allow you to play GTA 5 online with full efficiency.

  • To start, head over to ahkscript.org and click the Download button. Install the application on your PC.

GTA 5 AutoHotkey Macro Script Guide

  • After installing AutoHotkey, Right-Click on the Desktop, and click  New > AutoHotkey Script. This creates a new macro script on your desktop. Name the shortcut whatever you want. For the purpose of this tutorial I named the macro script “gta-test”.

GTA 5 AutoHotkey Macro Script Guide

  • Right click on “gta-test”   > Open With > Notepad.

GTA 5 AutoHotkey Macro Script Guide

 

  • Copy and paste the following code into the notepad and click “File > Save”

 

#NoEnv                          ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir %A_ScriptDir%     ; Ensures a consistent starting directory.
#IfWinActive ahk_class grcWindow  ; Disables hotkeys when alt-tabbed or GTA is closed.

;                                                               ———Assign Hotkey and Delay Values———

AutoHealthKey := “CapsLock”     ; Set keybinding for macro here. Automatic snacking. Eats 2 snacks from second snack slot.
HealthKey := “,”                ; Set keybinding for macro here. Open Snack menu.
ArmorKey := “F1”                ; Set keybinding for macro here.
PassiveKey := “F4”              ; Set keybinding for macro here.
RetCarKey := “F3”               ; Set keybinding for macro here.

IntMenuDelay := 120             ; Sets value(ms) for additional delay after opening interaction menu.
KeySendDelay := 25              ; Sets value(ms) for delay between send key commands.
KeyPressDuration := 5           ; Sets value(ms) for duration each key press is held down.

;                                                                       —-Hotkey Code Section—-

Hotkey, %AutoHealthKey%, AutoHealth     ; Assigns above value to hotkey. Do not change this line.
Hotkey, %HealthKey%, Health     ; Assigns above value to hotkey. Do not change this line.
Hotkey, %ArmorKey%, Armor       ; Assigns above value to hotkey. Do not change this line.
Hotkey, %PassiveKey%, Passive   ; Assigns above value to hotkey. Do not change this line.
Hotkey, %RetCarKey%, RetCar     ; Assigns above value to hotkey. Do not change this line.
Return

setkeydelay, KeySendDelay, KeyPressDuration             ; Sets delay(ms) between keystrokes issued. Arguments are delay between keystrokes and press duration, respectively.
; They might be able to go lower but these values are pretty fast and work reliably.

;                                                                         —-Macro Code Section—-

;                                                                            —-AutoHealth—-
;                                                                       Eats snacks automatically

AutoHealth:                     ; AutoHealth Macro

Send {m}                        ; Opens Interaction Menu
sleep, IntMenuDelay             ; Necessary delay to allow interaction menu to open properly while keeping keystroke delay short.
; Try to keep this value + the keystroke delay at least 80 ms for proper function.

Send {Down}{Down}{Enter}{Down}{Down}{Down}{Down}{Enter}   ; Keystrokes to open snack menu
Send {Down}{Enter}{Down}{Enter}{m}    ; Keystrokes to eat 1 of second snack

return                          ; Separates Hotkey Entries

;                                                                            —-Health—-
;                                                               Opens up snack menu for manual selection of snacks

Health:                                 ; Health Macro

Send {m}                        ; Opens Interaction Menu
sleep, IntMenuDelay             ; Necessary delay to allow interaction menu to open properly while keeping keystroke delay short.
; Try to keep this value + the keystroke delay at least 80 ms for proper function.

Send {Down}{Down}{Enter}{Down}{Down}{Down}{Down}{Enter}    ; Keystrokes to open snack menu

return                          ; Separates Hotkey Entries

;                                                                            —-Armor—-
;                                                               Equips super heavy armor and exits menu automatically

Armor:                          ; Armor Macro
Send {m}                        ; Opens Interaction Menu
sleep, IntMenuDelay             ; Necessary delay to allow interaction menu to open properly while keeping keystroke delay short.
; Try to keep this value + the keystroke delay at least 80 ms for proper function.

Send {Down}{Down}{Enter}{Down}{Down}{Enter}           ; Opens Armor Menu
Send {Down}{Down}{Down}{Down}{Enter}{m}         ; Equips super heavy armor and exits automatically. This line can be changed to pick different armor types.

return                          ; Separates Hotkey Entries

;                                                                         —-Passive Mode—-
;                                                                       Enters and exits passive mode

Passive:                        ; Passive Macro
Send {m}                        ; Opens Interaction Menu
sleep, IntMenuDelay             ; Necessary delay to allow interaction menu to open properly while keeping keystroke delay short.
; Try to keep this value + the keystroke delay at least 80 ms for proper function.

Send {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}{m}         ; Toggles passive mode and exits automatically
return                                                                  ; Separates Hotkey Entries

;                                                                     —-Retrieve Personal Vehicle—-
;                                                                   Requests delivery of personal vehicle

RetCar:                         ; Vehicle Request Macro
Send {m}                        ; Opens Interaction Menu
sleep, IntMenuDelay             ; Necessary delay to allow interaction menu to open properly while keeping keystroke delay short.
; Try to keep this value + the keystroke delay at least 80 ms for proper function.

Send {Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}{m}                         ; Requests vehicle and exits automatically
return                                                                  ; Separates Hotkey Entries

  • When you want to run the macro, right click on the “Gta-test” script file on your desktop and choose “Run as Administrator”. The macro will run in the background and enable you to use the following hotkeys while in GTA 5. You will see a green H in your task bar to indicate that the script is running. If you want to stop the macro script you can right click the task icon and Stop Script.GTA 5 AutoHotkey Macro Script Guide

GTA 5 Macro Script Hotkey Commands:

CapsLock: Automatically open menu and eat snacks.

F1: Automatically equip new body armor

F4: Enable/Disable Passive mode

 

Enjoy the script! This has been updated to work with the newest GTA 5 Online Update (Dec 2015 Bodyguard/Yacht update)

Josh

Josh is a do-it-yourself enthusiast. Wide range of interest including technology, automotive, computers, cooking, music, content creating. Josh enjoy's sharing what he has learned with others!

Leave a Reply

Your email address will not be published. Required fields are marked *