Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; GTA Online macros to apply armor, eat a snack, speed dial contacts and quickly toggle passive mode.
- ; Original script by RocketGrouch, modified and expanded by Anon.
- ; Basic settings and such for AHK
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- #Warn ; common errors
- #SingleInstance force
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- SetTitleMatchMode, 2 ; Necessary to match on the name of the window instead of window class in IfWinActive.
- ; shift+control+alt+r becomes a hotkey to reload this script. For me it is necessary to
- ; reload it after starting the game - with the hotkey I can do it without ever going to
- ; the desktop. Please note if you have any other program that uses this particular long
- ; key combo this will replace it througout your Windows.
- +^!r::Reload ; Assign Shift-Ctrl-Alt-R as a hotkey to restart the script.
- Sleep 1000 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached.
- MsgBox, 4,, The script could not be reloaded. Would you like to open it for editing?
- IfMsgBox, Yes, Edit
- return
- ; Grand Theft Auto V / Online specific macros begin here. Everything below the IfWinActive statement
- ; only happens if the GTA window is open and on top.
- #IfWinActive Grand Theft Auto V
- ; Why all these manual pauses and explicitly specifying both button press and button release,
- ; when I could be using SetKeyDelay? Because I couldn't get SetKeyDelay to work reliably in
- ; GTAO. This may be ugly, but if it's ugly and works perfectly its good enough for me.
- ; I made the steps into gosubs, just to make the actual macros below more readable and easy
- ; to edit. If your computer can handle even faster menu interaction, change the 60 in the
- ; Sleep statements to 50 or less. You'll probably start seeing lower reliability.
- Down:
- Send {Down down}
- Sleep, 60
- Send {Down up}
- Sleep, 60
- Return
- Right:
- Send {Right down}
- Sleep, 60
- Send {Right up}
- Sleep, 60
- Return
- Up:
- Send {up down}
- Sleep, 60
- Send {up up}
- Sleep, 60
- Return
- Enter:
- Send {Enter down}
- Sleep, 60
- Send {Enter up}
- Sleep, 60
- Return
- Menu:
- Send {M down}
- Sleep, 60
- Send {M up}
- Return
- Phone:
- Send {up down}
- Sleep, 60
- Send {up up}
- Return
- ; I use several keys on the Numpad to activate these macros.
- ; See https://www.autohotkey.com/docs/KeyList.htm if you need
- ; to find other keys. Also note that some of these don't work inside apartments.
- ; NumLock acts as a toggle for Solo play or when you are registered as a MC/CEO, this allows you to use the same hotkeys
- ; for equiping armor or eating a snack in these different modes. I have configured it like this because
- ; the interaction menu changes depending on if you are registered or not.
- ; NumLock ON if you are registered as a MC/CEO, NumLock OFF if you are not registered!
- ; Switching to the corresponding NumLock state is not required for Speed Dials to phone contacts.
- NumpadDel:: ; Super Heavy Armor SOLO
- Gosub, Menu
- Sleep, 250 ; Short delay to let the menu open properly
- Gosub, Down
- Gosub, Enter
- Gosub, Down
- Gosub, Enter
- Gosub, Up
- Gosub, Up
- Gosub, Up
- Gosub, Enter
- Gosub, Menu
- return
- NumpadIns:: ; Snack Cycle SOLO
- Gosub, Menu
- Sleep, 250
- Gosub, Down
- Gosub, Enter
- Gosub, Down
- Gosub, Down
- Gosub, Enter
- Gosub, Down
- Gosub, Enter
- Gosub, Menu
- return
- NumpadDot:: ; Super Heavy Armor MC/CEO
- Gosub, Menu
- Sleep, 250
- Gosub, Down
- Gosub, Down
- Gosub, Enter
- Gosub, Down
- Gosub, Enter
- Gosub, Up
- Gosub, Up
- Gosub, Up
- Gosub, Enter
- Gosub, Menu
- return
- Numpad0:: ; Snack Cycle MC/CEO
- Gosub, Menu
- Sleep, 250
- Gosub, Down
- Gosub, Down
- Gosub, Enter
- Gosub, Down
- Gosub, Down
- Gosub, Enter
- Gosub, Down
- Gosub, Enter
- Gosub, Menu
- return
- NumpadDown:: ; Pegasus ALL Numlock OFF
- Gosub, Phone
- Sleep, 550 ; Bringing up the phone requires a slightly longer delay
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40 ; Navigating through the contacts list requires a bit more delay for all inputs to register
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- Numpad2:: ; Pegasus ALL Numlock ON
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- NumpadEnd:: ; Mechanic ALL Numlock OFF
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- Numpad1:: ; Mechanic ALL Numlock ON
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- NumpadPgDn:: ; Insurance ALL Numlock OFF
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- Numpad3:: ; Insurance ALL Numlock ON
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- NumpadLeft:: ; Lester ALL Numlock OFF
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- Numpad4:: ; Lester ALL Numlock ON
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- NumpadClear:: ; Merryweather ALL Numlock OFF
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- Numpad5:: ; Merryweather ALL Numlock ON
- Gosub, Phone
- Sleep, 550
- Gosub, Up
- Gosub, Right
- Gosub, Enter
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Sleep, 40
- Gosub, Up
- Gosub, Enter
- return
- NumpadEnter:: ; Passive SOLO
- Gosub, Menu
- Sleep, 250
- Gosub, Up
- Gosub, Enter
- Gosub, Menu
- return
- #IfWinActive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement