diff --git a/.gitignore b/.gitignore index 0b0b21c..2454c0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ ps*.exe -config.ahk -custom.ahk +custom.ahk \ No newline at end of file diff --git a/GTA V Online Macros.ahk b/GTA V Online Macros.ahk index 972cde6..45e6b78 100755 --- a/GTA V Online Macros.ahk +++ b/GTA V Online Macros.ahk @@ -1,42 +1,32 @@ -; v1.3.1 +; v2.1.1 ; ^ don't remove or alter this line (autoupdate) #MaxThreadsPerHotkey 2 -; -; GTA V Online AHK-Macros v1.3.0 by 2called-chaos +; GTA V Online AHK-Macros v2.0.0 by mannly01 ; based on/inspired by GTA V Useful Macros v4.21 by twentyafterfour +; based on/inspired by GTA V Online Macros v1.3.1 by 2called-chaos +; https://github.com/2called-chaos/gtav-online-ahk ; ; # Description -; -; Provides hotkeys for opening snack menu, equipping armor, entering passive mode and much more. -; +; Provides hotkeys for many parts of the Interaction and Settings menus. ; ; # General Notes -; -; * Read the god damn readme, please! https://github.com/2called-chaos/gtav-online-ahk/blob/master/README.md -; * After cutscenes or just from time to time the interaction menu lags -; and the macro won't work. Periodically, especially after loading/cutscenes -; press m and backspace (aka open the menu once) -; * If you add something consider committing a pull request so we can all enjoy (VIP stuff for example) -; +; * Read the readme please! https://github.com/mannly01/gtav-online-ahk/blob/master/README.md. +; * After cutscenes or just from time to time the interaction menu lags +; and the macro won't work. Periodically, especially after loading/cutscenes +; press m and backspace (aka open the menu once). +; * This is a nearly complete re-write of 2called-chaos' script for GTA Online v1.69 (Bottom Dollar Bounties DLC). +; * If you add something consider committing a pull request so we can all enjoy. ; ; # Hotkeys / Binding: -; -; To change a hotkey for a macro change the configuration section at the top of the file -; or even better copy the line to your config.ahk (see Readme) and change it there. +; Please use the included config.ahk (see Readme) tp change the key bindings. ; A list of keynames for the non-alphanumeric can be found in the autohotkey help under ; the heading "Basic Usage and Syntax" with the name "Key List". ; They can also be found at https://www.autohotkey.com/docs/KeyList.htm ; -; ; # FAQ, Docs, Source, Bugs, etc. -; -; Read the wiki, propose features, fix and/or report bugs... it's all yours at -; -; https://github.com/2called-chaos/gtav-online-ahk -; - - +; To propose features, fix and/or report bugs... +; https://github.com/2called-chaos/gtav-online-ahk/issues ; ============================== ; === CONFIGURATION GOES vvv === @@ -46,68 +36,77 @@ ; https://www.autohotkey.com/docs/KeyList.htm ; WARNING: If you don't want to use a certain binding use "F24" ; or any other valid key or it will break! -; Consider using a config.ahk! -SnackMenuKey := "+#" ; Open Snack menu (+ = shift, rtfm). -AutoHealthKey := "#" ; Automatic snacking. Eats 2 snacks from second snack slot. -ArmorMenuKey := "+F1" ; Open Armor menu. -AutoArmorKey := "F1" ; Automatic armor equip (uses super heavy armor only). -RetrieveCarKey := "F2" ; Request currently active Personal Vehicle. -ToggleRadarKey := "+F2" ; Toggle between extended and standar radar. -CEOBuzzardKey := "F3" ; Spawn free CEO buzzard -RequestSparrowKey := "+F3" ; Call in your Sparrow (or whatever you last requested moon pool vehicle was) -ReturnSparrowKey := "^F3" ; Return your Sparrow to the Kosatka -ForceDisconnectKey := "F12" ; Force disconnect by suspending process for 10s, requires pssuspend.exe -KillGameKey := "+F12" ; Kill game process, requires pskill.exe -ToggleVIPKey := "NumpadMult" ; Toggle VIP mode (required when VIP/CEO/MC). Won't have effect if using ManualInventoryLocation option. -ToggleCPHKey := "^NumpadMult" ; Toggle Cayo Perico Heist Final mode (extra menu entry), also see DoToggleCPHWithVIP. Won't have effect if using ManualInventoryLocation option. -ToggleAFKKey := "+NumpadMult" ; Toggle AFK mode +; +; USE config.ahk INSTEAD OF CHANGING THE KEYS BELOW! +; +SnackMenuKey := "F24" ; Open Snack menu (+ = shift, rtfm). +AutoHealthKey := "F24" ; Automatic snacking. Eats 2 snacks from second snack slot. +ArmorMenuKey := "F24" ; Open Armor menu. +AutoArmorKey := "F24" ; Automatic armor equip (uses super heavy armor only). +RetrieveCarKey := "F24" ; Request currently active Personal Vehicle. +ReturnCarKey := "F24" ; Return the currently active Personal Vehicle. +ToggleRadarKey := "F24" ; Toggle between extended and standar radar. +CEOBuzzardKey := "F24" ; Spawn free CEO buzzard. +RequestSparrowKey := "F24" ; Call in your Sparrow (or whatever you last requested moon pool vehicle was). +ReturnSparrowKey := "F24" ; Return your Sparrow to the Kosatka. +RequestKosatkaKey := "F24" ; Call in your Kosatka Submarine. +RequestOppressorKey := "F24" ; Call in your Oppressor Mk II. +ForceDisconnectKey := "F24" ; Force disconnect by suspending process for 10s, requires pssuspend.exe. +KillGameKey := "F24" ; Kill game process, requires pskill.exe. + +ToggleInBuildingKey := "F24" ; Toggle In Building mode. +ToggleCPHKey := "F24" ; Toggle Cayo Perico Heist mode. +ToggleAFKKey := "F24" ; Toggle AFK mode. + +TurnOnCEOKey := "F24" ; Makes you CEO of an Organization and toggles VIP mode. +TurnOnPresKey := "F24" ; Makes you President of a MC Club and toggles VIP mode. +ResignOrDisbandKey := "F24" ; Resigns your CEO position or Disbands your MC Club and toggles VIP mode. TogglePassiveKey := "F24" ; Toggle passive mode. -ToggleClickerKey := "F24" ; Toggle Clicker (XButton2 = Mouse5) -ToggleAutoHeliKey := "F24" ; Keeps throttle and pitch forward pressed, First take heli to sufficient height and then use this as autopilot -ChatSnippetsKey := "F24" ; Gives you a few text snippets to put in chat (chat must be already open) +ToggleClickerKey := "F24" ; Toggle Clicker (XButton2 = Mouse5). +ToggleAutoHeliKey := "F24" ; Keeps throttle and pitch forward pressed, First take heli to sufficient height and then use this as autopilot. +ToggleAutoPlaneKey := "F24" ; Keeps throttle at max for plane autopilot. +ChatSnippetsKey := "F24" ; Gives you a few text snippets to put in chat (chat must be already open). CycleOutfitKey := "F24" ; Equip next/cycle through saved outfits. -RandomHeistKey := "F24" ; Chooses on-call random heist from phone options +RandomHeistKey := "F24" ; Chooses on-call random heist from phone options. EquipScarfKey := "F24" ; Equip first scarf (heist outfit glitch, see readme/misc). -DialDialogKey := "+F5" ; Call GUI with a list of almost all numbers -CallMechanicKey := "F5" ; Call Mechanic -CallPegasusKey := "F24" ; Call Pegasus -CallMerryweatherKey := "F24" ; Call Merryweather -CallInsuranceKey := "F6" ; Call Insurance -CallLesterKey := "+F6" ; Call Lester -CallAssistantKey := "^F6" ; Call Assistant +NewPublicSessionKey := "F24" ; Join a New Public Session +NewInviteSessionKey := "F24" ; Join a New Invite Only Session. +NewCrewSessionKey := "F24" ; Join a New Crew Only Session. +NewFriendSessionKey := "F24" ; Join a New Friend Only Session. -CheckForUpdatesKey := "F24" ; Checks on startup by default, see DoCheckForUpdates option +DialDialogKey := "F24" ; Call GUI with a list of almost all numbers. +CallMechanicKey := "F24" ; Call Mechanic. +CallPegasusKey := "F24" ; Call Pegasus. +CallMerryweatherKey := "F24" ; Call Merryweather. +CallInsuranceKey := "F24" ; Call Insurance. +CallLesterKey := "F24" ; Call Lester. +RemoveWantedLevelKey := "F24" ; Call Lester and have him remove wanted level. +CallAssistantKey := "F24" ; Call Assistant. +CreateManualSaveKey := "F24" ; Use the outfit selection to create a manual save (doesn't change outfits). -; ManualInventoryLocation (manual inventory line calibration) -ManualInventoryLocation := false ; if true, use manual calibration of the inventory line in the interactive menu. IsCPHActive and IsVIPActive flags will be ignored. -InvLocation := 4 ; by default, this is the location of the inventory in the menu -AutoSnackLocation := 2 ; by default, this is the snack autosnack will select -; these keys will not be bound if ManualInventoryLocation is false -IncInvKey := "NumpadAdd" ; for increasing the value of the inventory line -DecInvKey := "NumpadSub" ; for decreasing the value of the inventory line -IncSnackKey := "^NumpadAdd" ; for increasing the line for the snack selected by autosnacking -DecSnackKey := "^NumpadSub" ; for decreasing the line for the snack selected by autosnacking +CheckForUpdatesKey := "F24" ; Checks on startup by default, see DoCheckForUpdates option. +AutoSnackLocation := 2 ; by default this is the snack that autosnack will select. +AutoArmorLocation := 5 ; by default this is Super Heavy Armor, but can be changed. ; Options (should be fine out of the box) -WindowScale := 1.0 ; Change this to reflect your Windows display scale (e.g. set it to 3 if you have UI scale set to 300%) -DoConfirmKill := true ; If true the KillGame action will ask for confirmation before killing the process -DoConfirmDisconnect := true ; If true the ForceDisconnect action will ask for confirmation before suspending the process -IntDisconnectDelay := 10 ; Amount of seconds to freeze the process for, 10 works fine -DoToggleCPHWithVIP := false ; If true ToggleVIP will become a 3-way toggle (off/on/CayoPericoHeistFinal) -DisableCapsOnAction := true ; Disable caps lock before executing macros, some macros might fail if caps lock is on -DoCheckForUpdates := true ; Check for script updates on startup (you can manually bind this instead or additionally) - +WindowScale := 1.0 ; Change this to reflect your Windows display scale (e.g. set it to 3 if you have UI scale set to 300%). +DoConfirmKill := true ; If true the KillGame action will ask for confirmation before killing the process. +DoConfirmDisconnect := true ; If true the ForceDisconnect action will ask for confirmation before suspending the process. +IntDisconnectDelay := 10 ; Amount of seconds to freeze the process for, 10 works fine. +DoToggleCPHWithVIP := false ; If true ToggleVIP will become a 3-way toggle (off/on/CayoPericoHeistFinal). +DisableCapsOnAction := true ; Disable caps lock before executing macros, some macros might fail if caps lock is on. +DoCheckForUpdates := true ; Check for script updates on startup (you can manually bind this instead or additionally). ; Internal variables (probably no need to edit) -IsVIPActivated := false ; Initial status of CEO/VIP mode (after (re)loading script) -IsAFKActivated := false ; Initial status of AFK mode (should always be false) -IsCPHActivated := false ; Initial status of CPH mode (should always be false) -IsClickerActivated := false ; Initial status of Clicker (should always be false) - +IsVIPActivated := false ; Initial status of CEO/VIP mode (after (re)loading script). +IsAFKActivated := false ; Initial status of AFK mode (should always be false). +IsCPHActivated := false ; Initial status of CPH mode (should always be false). +IsClickerActivated := false ; Initial status of Clicker (should always be false). +IsInBuilding := false ; Initial status of In Building mode (the Interaction Menu changes when the player is in a building) ; Chat snippets (you can add more, comment them out or remove them, the pushs that is) ArrayChatSnippets := [] @@ -116,7 +115,6 @@ ArrayChatSnippets.push("Yay, cheaters") ArrayChatSnippets.push("I take that explosive sniper of yours and insert it sideways...") ArrayChatSnippets.push("You want some cool AHK macros? github.com/2called-chaos/gtav-online-ahk") - ; Delays (you normally don't want to change these, you can try to play with these values if you have a slow/fast PC) IntFocusDelay := 100 ; delay (in ms) after focussing game when AHK-GUI took focus. IntMenuDelay := 120 ; delay (in ms) after opening interaction menu. @@ -126,7 +124,6 @@ IntPhoneScrollDelay := 75 ; delay (in ms) between scrolls in the phone menu. IntKeySendDelay := 25 ; delay (in ms) delay between send key commands. IntKeyPressDuration := 5 ; duration (in ms) each key press is held down. - ; In case you changed your ingame bindings: global IGB_Interaction := "m" global IGB_Phone := "up" @@ -141,10 +138,10 @@ global IGB_Enter := "enter" ; the following refer to movement (used for AFK) global IGB_MoveLeft := "a" global IGB_MoveRight := "d" -; aircraft/helicopter +; aircraft/helicopter (for autopilot) global IGB_ThrottleUp := "w" global IGB_PitchForward := "Numpad8" - +global IGB_PitchBack := "Numpad5" ; Phone numbers for DialDialog GUI dialog (you can change the order if you want or hide entries by commenting them out) ArrayPhonebook := [] @@ -187,27 +184,20 @@ ArrayPhonebook.push("328-555-0177 - Sapphire (Prostitute)") ;ArrayPhonebook.push("1-999-768822 - (useless) 'This number is no longer in service'") ;ArrayPhonebook.push("273-555-0155 - (useless) Truthseeker Helpline") - ; Create a file (at the same location as this one) named "config.ahk" ; and overwrite settings without changing them here (easier to update). ; See Readme for more info. #Include *i config.ahk - ; ============================== ; === CONFIGURATION GOES ^^^ === ; ============================== - - - - ; ================================================ ; === Are you sure you want to scroll further? === ; ================================================ - #NoEnv SetWorkingDir A_ScriptDir @@ -215,42 +205,60 @@ SetWorkingDir A_ScriptDir #IfWinActive ahk_class grcWindow ; Hotkey/Function mapping -Hotkey, %CheckForUpdatesKey%, CheckForUpdates Hotkey, %SnackMenuKey%, SnackMenu Hotkey, %AutoHealthKey%, AutoHealth Hotkey, %ArmorMenuKey%, ArmorMenu Hotkey, %AutoArmorKey%, AutoArmor -Hotkey, %TogglePassiveKey%, TogglePassive + Hotkey, %RetrieveCarKey%, RetrieveCar -Hotkey, %EquipScarfKey%, EquipScarf -Hotkey, %CycleOutfitKey%, CycleOutfit -Hotkey, %ToggleVIPKey%, ToggleVIP +Hotkey, %ReturnCarKey%, ReturnCar +Hotkey, %CEOBuzzardKey%, CEOBuzzard +Hotkey, %RequestSparrowKey%, RequestSparrow +Hotkey, %ReturnSparrowKey%, ReturnSparrow +Hotkey, %RequestKosatkaKey%, RequestKosatka +Hotkey, %RequestOppressorKey%, RequestOppressor + +Hotkey, %ForceDisconnectKey%, ForceDisconnect +Hotkey, %KillGameKey%, KillGame + +Hotkey, %ToggleInBuildingKey%, ToggleInBuilding Hotkey, %ToggleCPHKey%, ToggleCPH Hotkey, %ToggleAFKKey%, ToggleAFK -Hotkey, %ToggleClickerKey%, ToggleClicker + +Hotkey, %TurnOnCEOKey%, TurnOnCEO +Hotkey, %TurnOnPresKey%, TurnOnPres +Hotkey, %ResignOrDisbandKey%, ResignOrDisband + +Hotkey, %TogglePassiveKey%, TogglePassive Hotkey, %ToggleRadarKey%, ToggleRadar +Hotkey, %ToggleClickerKey%, ToggleClicker + HotKey, %ToggleAutoHeliKey%, ToggleAutoHeli -Hotkey, %KillGameKey%, KillGame -Hotkey, %ForceDisconnectKey%, ForceDisconnect -Hotkey, %RandomHeistKey%, RandomHeist +Hotkey, %ToggleAutoPlaneKey%, ToggleAutoPlane + Hotkey, %ChatSnippetsKey%, ChatSnippets -Hotkey, %CEOBuzzardKey%, CEOBuzzard -Hotkey, %RequestSparrowKey%, RequestSparrow -Hotkey, %ReturnSparrowKey%, ReturnSparrow + +Hotkey, %CreateManualSaveKey%, CreateManualSave +Hotkey, %CycleOutfitKey%, CycleOutfit +Hotkey, %EquipScarfKey%, EquipScarf + +Hotkey, %NewPublicSessionKey%, NewPublicSession +Hotkey, %NewInviteSessionKey%, NewInviteSession +Hotkey, %NewCrewSessionKey%, NewCrewSession +Hotkey, %NewFriendSessionKey%, NewFriendSession + +Hotkey, %RandomHeistKey%, RandomHeist + Hotkey, %DialDialogKey%, DialDialog Hotkey, %CallMechanicKey%, CallMechanic Hotkey, %CallPegasusKey%, CallPegasus Hotkey, %CallMerryweatherKey%, CallMerryweather Hotkey, %CallInsuranceKey%, CallInsurance Hotkey, %CallLesterKey%, CallLester +Hotkey, %RemoveWantedLevelKey%, RemoveWantedLevel Hotkey, %CallAssistantKey%, CallAssistant -if(ManualInventoryLocation) { - Hotkey, %IncInvKey%, IncrementInventoryLocation - Hotkey, %DecInvKey%, DecrementInventoryLocation - Hotkey, %IncSnackKey%, IncrementSnackLocation - Hotkey, %DecSnackKey%, DecrementSnackLocation -} +Hotkey, %CheckForUpdatesKey%, CheckForUpdates ; 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. @@ -269,7 +277,6 @@ Return #Include *i custom.ahk - ; ================= ; === Functions === ; ================= @@ -284,52 +291,66 @@ turnCapslockOff() { } } -openInteractionMenu(isVIPActive, isCPHActive, goingDown) { +openInteractionMenu() { global IntMenuDelay - global ManualInventoryLocation - global InvLocation turnCapslockOff() Send {%IGB_Interaction%} sleep, IntMenuDelay +} - if goingDown { - TimesDown := 0 - if (ManualInventoryLocation = 1) { - TimesDown := InvLocation - 1 - } - else { - if (isCPHActive = 1) { - TimesDown := 2 - } - ; else if (isVIPActive = 1) { - ; TimesDown := 1 - ; } - } - Loop %TimesDown% { - Send {%IGB_Down%} - } - } +openManageVehicleMenu(IsInBuilding) { + openInteractionMenu() + if (IsCPHActivated) + Send {%IGB_Down%} + Send {%IGB_Down% 2} + if (IsInBuilding) + Send {%IGB_Down%} + Send {%IGB_Enter%} +} + +openServiceVehicleMenu(IsInBuilding) { + openInteractionMenu() + if (IsCPHActivated) + Send {%IGB_Down%} + Send {%IGB_Down% 3} + if (IsInBuilding) + Send {%IGB_Down%} + Send {%IGB_Enter%} +} + +openHealthAmmoMenu(IsInBuilding) { + openInteractionMenu() + if (IsCPHActivated) + Send {%IGB_Down%} + Send {%IGB_Down% 4} + if (IsInBuilding) + Send {%IGB_Down%} + Send {%IGB_Enter%} +} + +openSnackMenu(IsInBuilding) { + openHealthAmmoMenu(IsInBuilding) + Send {%IGB_Down% 2}{%IGB_Enter%} } -openSnackMenu() { - global ManualInventoryLocation - if !ManualInventoryLocation - Send {%IGB_Down%}{%IGB_Down%}{%IGB_Down%}{%IGB_Down%} - Send {%IGB_Enter%}{%IGB_Down%}{%IGB_Down%}{%IGB_Enter%} +openArmorMenu(IsInBuilding) { + openHealthAmmoMenu(IsInBuilding) + Send {%IGB_Down%}{%IGB_Enter%} } -openArmorMenu() { - global ManualInventoryLocation - if !ManualInventoryLocation - Send {%IGB_Down%}{%IGB_Down%}{%IGB_Down%}{%IGB_Down%} - Send {%IGB_Enter%}{%IGB_Down%}{%IGB_Enter%} +openAppearanceMenu(IsInBuilding) { + openInteractionMenu() + if (IsCPHActivated) + Send {%IGB_Down%} + Send {%IGB_Down% 5} + if (IsInBuilding) + Send {%IGB_Down%} + Send {%IGB_Enter%} } -openOutfitMenu() { - global ManualInventoryLocation - if !ManualInventoryLocation - Send {%IGB_Down%}{%IGB_Down%}{%IGB_Down%} - Send {%IGB_Down%}{%IGB_Down%}{%IGB_Enter%}{%IGB_Down%}{%IGB_Down%}{%IGB_Down%} +openAccessoriesMenu(IsInBuilding) { + openAppearanceMenu(IsInBuilding) + Send {%IGB_Down%}{%IGB_Enter%} } openPhone() { @@ -476,12 +497,11 @@ bringGameIntoFocus(applyDelay = false) { } - ; ============== ; === UPDATE === ; ============== performUpdateCheck(silentSuccess = false) { - URLDownloadToFile,https://raw.githubusercontent.com/2called-chaos/gtav-online-ahk/master/GTA`%20V`%20Online`%20Macros.ahk,update.txt + URLDownloadToFile,https://raw.githubusercontent.com/mannly01/gtav-online-ahk/master/GTA`%20V`%20Online`%20Macros.ahk,update.txt if (errorlevel) { msgbox, 0, Error - GTA V Online AHK-Macros, Received error response from GitHub and update check was canceled.`nPlease retry later or check manually.`n`nHint: Set DoCheckForUpdates to false to disable automatic checking! FileDelete, update.txt @@ -490,11 +510,13 @@ performUpdateCheck(silentSuccess = false) { FileReadLine, update, update.txt, 1 FileReadLine, currentVersion, %A_ScriptName%, 1 - if (update = currentVersion) { + update := StrReplace(update, "; v", "") + currentVersion := StrReplace(currentVersion, "; v", "") + if (VerCompare(update, currentVersion) = 0) { FileDelete, update.txt if (!silentSuccess) - msgbox, You are running the latest version!`n`n%update%`n`nIf something doesn't work please let me know!`n`nhttps://github.com/2called-chaos/gtav-online-ahk - } else if (InStr(update, "; v") = 1) { + msgbox, You are running the latest version!`n`n%update%`n`nIf something doesn't work please let me know!`n`nhttps://github.com/2called-chaos/gtav-online-ahk/issues/ + } else if (VerCompare(update, currentVersion) = 1) { MsgBox, 4, Update available! - GTA V Online AHK-Macros, A new version of GTA V Online AHK-Macros has been released!`n`n%currentVersion% <-- your version`n%update% <-- available update`n`nWould you like to update?`n`nWarning: If you don't use config.ahk this might reset all your settings! IfMsgBox Yes { @@ -508,6 +530,9 @@ performUpdateCheck(silentSuccess = false) { msgbox, This script will NOT be updated!`n`nHint: Set DoCheckForUpdates to false to disable automatic checking! FileDelete, update.txt } + } else if (VerCompare(update, currentVersion) = -1) { + msgbox, This script will NOT be updated!`n`n%currentVersion% <-- your version`n%update% <-- available update + FileDelete, update.txt } else { msgbox, 0, Error - GTA V Online AHK-Macros, Received invalid response from GitHub and update check was canceled.`nPlease retry later or check manually.`n`nHint: Set DoCheckForUpdates to false to disable automatic checking! FileDelete, update.txt @@ -519,7 +544,6 @@ CheckForUpdates: return - ; =================== ; === Subroutines === ; =================== @@ -593,20 +617,18 @@ ToggleRadar: turnCapslockOff() SoundPlay, %A_WinDir%\Media\Windows Battery Critical.wav Send {%IGB_Pause%} - - ; Necessary delay to allow settings to open properly - sleep, IntPhoneMenuDelay2 - + ; Necessary delay to allow pause menu to open properly + Sleep, IntPhoneMenuDelay2 ; Not using IGB_ variables on purpose as pause menu has static bindings - Send {Right}{Right}{Right}{Right}{Right} + Send {Right 5} Sleep IntPhoneMenuDelay2 * 2 - Send {Enter} + Send {Enter} ; Settings Menu Sleep IntPhoneMenuDelay2 - Send {Down}{Down}{Down}{Down}{Down} + Send {Down 5} Sleep IntPhoneMenuDelay2 Send {Enter} Sleep IntPhoneMenuDelay2 - Send {Down}{Down}{Down}{Down}{Down} + Send {Down 5} Sleep IntPhoneMenuDelay2 Send {Enter} Sleep IntPhoneMenuDelay2 @@ -636,44 +658,59 @@ ToggleClicker: } return -; Toggle VIP mode (if VIP/CEO/MC all interaction menu entries are offset by one) -ToggleVIP: - if (IsVIPActivated) { - if (DoToggleCPHWithVIP) { - if (IsCPHActivated) { - IsCPHActivated := false - IsVIPActivated := false - SplashTextOn 280 * WindowScale, 20 * WindowScale, VIP&CPH mode, VIP&&CPH mode has been DEACTIVATED - } else { - IsCPHActivated := true - SplashTextOn 350 * WindowScale, 20 * WindowScale, CPH mode, Cayo Perico Heist mode has been ACTIVATED - } - } else { - IsVIPActivated := false - SplashTextOn 250 * WindowScale, 20 * WindowScale, VIP mode, VIP mode has been DEACTIVATED - } +; Toggle CPH mode (Cayo Perico Heist Final) +ToggleCPH: + IsCPHActivated := !IsCPHActivated + if (IsCPHActivated) { + SplashTextOn 350 * WindowScale, 20 * WindowScale, CPH mode, Cayo Perico Heist mode has been ACTIVATED } else { - IsVIPActivated := true - SplashTextOn 250 * WindowScale, 20 * WindowScale, VIP mode, VIP mode has been ACTIVATED + SplashTextOn 350 * WindowScale, 20 * WindowScale, CPH mode, Cayo Perico Heist mode has been DEACTIVATED } Sleep 2000 SplashTextOff bringGameIntoFocus() return -; Toggle CPH mode (Cayo Perico Heist Final) -ToggleCPH: - IsCPHActivated := !IsCPHActivated - if (IsCPHActivated) { - SplashTextOn 350 * WindowScale, 20 * WindowScale, CPH mode, Cayo Perico Heist mode has been ACTIVATED +; Toggle In Building mode (the Interation Menu chagnes when the player is in certain buildings) +ToggleInBuilding: + IsInBuilding := !IsInBuilding + if (IsInBuilding) { + SplashTextOn 350 * WindowScale, 20 * WindowScale, In Building, You are in a building } else { - SplashTextOn 350 * WindowScale, 20 * WindowScale, CPH mode, Cayo Perico Heist mode has been DEACTIVATED + SplashTextOn 350 * WindowScale, 20 * WindowScale, In Building, You are not in a building } Sleep 2000 SplashTextOff bringGameIntoFocus() return +; Makes you CEO of an Organization and toggles VIP mode. +TurnOnCEO: + openInteractionMenu() + Send {%IGB_Down%} + if (IsInBuilding) + Send {%IGB_Down%} + Send {%IGB_Enter% 3} + IsVIPActivated := true + return + +; Makes you President of a MC Club and toggles VIP mode. +TurnOnPres: + openInteractionMenu() + Send {%IGB_Down%} + if (IsInBuilding) + Send {%IGB_Down%} + Send {%IGB_Enter%}{%IGB_Down%}{%IGB_Enter% 2} + IsVIPActivated := true + return + +; Resigns your CEO position or Disbands your MC Club and toggles VIP mode. +ResignOrDisband: + openInteractionMenu() + Send {%IGB_Enter%}{%IGB_Up%}{%IGB_Enter%} + IsVIPActivated := false + return + ; Helicopter autopilot (hold throttle and forward) AutoHeli: SetKeyDelay, -1 @@ -682,6 +719,8 @@ AutoHeli: Send, {Blind}{%IGB_PitchForward% DownTemp} } else { SetTimer, AutoHeli, OFF + SetTimer, AutoPlane, OFF + SetTimer, AutoPlaneElevator, OFF Send, {Blind}{%IGB_ThrottleUp% Up} Send, {Blind}{%IGB_PitchForward% Up} } @@ -698,108 +737,112 @@ ToggleAutoHeli: } return -IncrementInventoryLocation: - InvLocation := InvLocation + 1 - SplashTextOn 350 * WindowScale, 20 * WindowScale, Increase Inventory Line, The Inventory Line is now %InvLocation% - Sleep 2000 - SplashTextOff - bringGameIntoFocus() - return - -DecrementInventoryLocation: - InvLocation := InvLocation - 1 - if (InvLocation < 1) { - InvLocation := 1 +; Plane autopilot (hold throttle) +AutoPlane: + SetKeyDelay, -1 + if (autoHeliToggle) { + Send, {Blind}{%IGB_ThrottleUp% DownTemp} + } else { + SetTimer, AutoPlane, OFF + SetTimer, AutoPlaneElevator, OFF + SetTimer, AutoHeli, OFF + Send, {Blind}{%IGB_ThrottleUp% Up} + Send, {Blind}{%IGB_PitchForward% Up} } - SplashTextOn 350 * WindowScale, 20 * WindowScale, Decrease Inventory Line, The Inventory Line is now %InvLocation% - Sleep 2000 - SplashTextOff - bringGameIntoFocus() return -IncrementSnackLocation: - AutoSnackLocation := AutoSnackLocation + 1 - SplashTextOn 350 * WindowScale, 20 * WindowScale, Incease AutoSnack Line, The Snack Line is now %AutoSnackLocation% - Sleep 2000 - SplashTextOff - bringGameIntoFocus() +; Plane Elevator Timer (Velum airplane constantly loses altitude with "neutral" elevator) +AutoPlaneElevator: + SetKeyDelay, -1 + if (autoHeliToggle) { + Send {%IGB_PitchBack%} + } return -DecrementSnackLocation: - AutoSnackLocation := AutoSnackLocation - 1 - if (AutoSnackLocation < 1) { - AutoSnackLocation := 1 +ToggleAutoPlane: + autoHeliToggle := ( autoHeliToggle ? 0 : 1 ) + if (autoHeliToggle) { + SetTimer, AutoPlane, 50 + SetTimer, AutoPlaneElevator, 2500 + SoundPlay, %A_WinDir%\Media\Windows Battery Critical.wav + } else { + SoundPlay, %A_WinDir%\Media\Windows Balloon.wav } - - SplashTextOn 350 * WindowScale, 20 * WindowScale, Decrease AutoSnack Line, The Snack Line is now %AutoSnackLocation% - Sleep 2000 - SplashTextOff - bringGameIntoFocus() return ; Open up snack menu for manual selection (or stock check) of snacks SnackMenu: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - openSnackMenu() + openSnackMenu(IsInBuilding) return ; Automatic snacking. Eats 2 snacks from AutoSnackLocation slot and close menu. AutoHealth: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - openSnackMenu() - if ManualInventoryLocation - TimesDown := AutoSnackLocation - 1 - else - TimesDown := 1 + openSnackMenu(IsInBuilding) + TimesDown := AutoSnackLocation - 1 Loop %TimesDown% { Send {%IGB_Down%} } - Send {%IGB_Enter%}{%IGB_Enter%}{%IGB_Interaction%} + Send {%IGB_Enter% 2}{%IGB_Interaction%} return ; Open up armor menu for manual selection (or stock check) of armor ArmorMenu: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - openArmorMenu() + openArmorMenu(IsInBuilding) return ; Equips super heavy armor and exits menu automatically AutoArmor: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - openArmorMenu() - Send {%IGB_Down% 4}{%IGB_Enter%}{%IGB_Interaction%} + openArmorMenu(IsInBuilding) + TimesDown := AutoArmorLocation - 1 + Loop %TimesDown% { + Send {%IGB_Down%} + } + Send {%IGB_Enter%}{%IGB_Interaction%} return ; Equips scarf to allow faster running with heist armor (see readme/misc) EquipScarf: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - if !ManualInventoryLocation - Send {%IGB_Down%}{%IGB_Down%}{%IGB_Down%}{%IGB_Down%}{%IGB_Down%} - ; Opens scarf menu - Send {%IGB_Down%}{%IGB_Enter%} + openAccessoriesMenu(IsInBuilding) + Send {%IGB_Down% 9} ; equip scarf and exit menu. This line can be changed to pick different scarfs. - Send {%IGB_Up% 4}{%IGB_Right%}{%IGB_Interaction%} + Send {%IGB_Right%}{%IGB_Interaction%} return ; Cycle between your saved outfits CycleOutfit: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - openOutfitMenu() - Send {%IGB_Right%}{%IGB_Enter%}{%IGB_Interaction%} + openAppearanceMenu(IsInBuilding) + Send {%IGB_Down% 3}{%IGB_Right%}{%IGB_Enter%}{%IGB_Interaction%} + return + +; Use the outfit option to create a manual save +CreateManualSave: + openAppearanceMenu(IsInBuilding) + Send {%IGB_Down% 3}{%IGB_Enter%}{%IGB_Interaction%} return ; Toggle passive mode TogglePassive: - openInteractionMenu(false, false, false) ; Ignore VIP status when going up + openInteractionMenu() Send {%IGB_Up%}{%IGB_Enter%}{%IGB_Interaction%} return ; Retrieve your currently active vehicle RetrieveCar: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - if !ManualInventoryLocation - Send {%IGB_Down%}{%IGB_Down%} - Send {%IGB_Enter%}{%IGB_Enter%}{%IGB_Interaction%} + if (IsInBuilding) { + SplashTextOn 350 * WindowScale, 20 * WindowScale, Not Allowed, You cannot call your vehicle in a building + Sleep 2000 + SplashTextOff + bringGameIntoFocus() + } else { + openManageVehicleMenu(false) + Send {%IGB_Enter% 2}{%IGB_Interaction%} + } + return + +; Return your currently active vehicle +ReturnCar: + openManageVehicleMenu(IsInBuilding) + Send {%IGB_Up% 2}{%IGB_Enter%}{%IGB_Interaction%} return ; Chooses on-call random heist from phone options @@ -810,29 +853,158 @@ RandomHeist: Send {%IGB_Enter%} sleep IntKeySendDelay scrollPhoneUp(2) ; scroll up twice to solo-q - Send {%IGB_Enter%}{%IGB_Enter%} + Send {%IGB_Enter% 2} return ; Calls in free CEO buzzard (if you are CEO) CEOBuzzard: - openInteractionMenu(false, false, false) - Send {%IGB_Enter%}{%IGB_Up% 2}{%IGB_Enter%}{%IGB_Down% 4}{%IGB_Enter%} + if (!IsVIPActivated) { + SplashTextOn 350 * WindowScale, 20 * WindowScale, Not Allowed, You must be a CEO to call the Buzzard + Sleep 2000 + SplashTextOff + bringGameIntoFocus() + } else { + if (IsInBuilding) { + SplashTextOn 350 * WindowScale, 20 * WindowScale, Not Allowed, You cannot call your Buzzard in a building + Sleep 2000 + SplashTextOff + bringGameIntoFocus() + } else { + openInteractionMenu() + Send {%IGB_Enter%}{%IGB_Up% 2}{%IGB_Enter%}{%IGB_Down% 4}{%IGB_Enter%} + } + } return ; Call in your Sparrow (or whatever you last requested moon pool vehicle was) RequestSparrow: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - if !ManualInventoryLocation - Send {%IGB_Down%}{%IGB_Down%}{%IGB_Down%} - Send {%IGB_Enter%}{%IGB_Up%}{%IGB_Up%}{%IGB_Enter%}{%IGB_Down%}{%IGB_Enter%} + if (IsInBuilding) { + SplashTextOn 350 * WindowScale, 20 * WindowScale, Not Allowed, You cannot call your Sparrow in a building + Sleep 2000 + SplashTextOff + bringGameIntoFocus() + } else { + openServiceVehicleMenu(false) + ; Open Kosatka Menu + Send {%IGB_Up% 2}{%IGB_Enter%} + ; Call the Sparrow + Send {%IGB_Down%}{%IGB_Enter%} + } return ; Return your Sparrow to the Kosatka ReturnSparrow: - openInteractionMenu(IsVIPActivated, IsCPHActivated, true) - if !ManualInventoryLocation - Send {%IGB_Down%}{%IGB_Down%}{%IGB_Down%} - Send {%IGB_Enter%}{%IGB_Up%}{%IGB_Up%}{%IGB_Enter%}{%IGB_Down% 3}{%IGB_Enter%}{%IGB_Up%}{%IGB_Up%}{%IGB_Enter%} + openServiceVehicleMenu(IsInBuilding) + ; Open Kosatka Menu + Send {%IGB_Up% 2}{%IGB_Enter%} + ; Open Return Options Menu + Send {%IGB_Down% 3}{%IGB_Enter%} + ; Return the Sparrow + Send {%IGB_Up% 2}{%IGB_Enter%}{%IGB_Interaction%} + return + +; Call in your Kosatka Submarine +RequestKosatka: + openServiceVehicleMenu(IsInBuilding) + ; Open Kosatka Menu + Send {%IGB_Up% 2}{%IGB_Enter%} + ; Call Kosatka + Send {%IGB_Enter%} + return + +; Call in your Oppressor Mk II +RequestOppressor: + openServiceVehicleMenu(IsInBuilding) + ; Open TerrorByte Menu + Send {%IGB_Up% 3}{%IGB_Enter%} + ; Call Oppressor Mk II + Send {%IGB_Down% 2}{%IGB_Enter%}{%IGB_Interaction%} + return + +; Join a New Public Session +NewPublicSession: + turnCapslockOff() + SoundPlay, %A_WinDir%\Media\Windows Battery Critical.wav + Send {%IGB_Pause%} + ; Necessary delay to allow pause menu to open properly + Sleep, IntPhoneMenuDelay2 + Send {Right} + Sleep IntPhoneMenuDelay2 * 2 + Send {Enter} ; Online Menu + Sleep IntPhoneMenuDelay2 + Send {Up 4} + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Session Menu + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Public Session + Sleep IntPhoneMenuDelay2 + Send {Enter} ; Confirm Session Change + return + +; Join a New Invite Only Session +NewInviteSession: + turnCapslockOff() + SoundPlay, %A_WinDir%\Media\Windows Battery Critical.wav + Send {%IGB_Pause%} + ; Necessary delay to allow pause menu to open properly + Sleep, IntPhoneMenuDelay2 + Send {Right} + Sleep IntPhoneMenuDelay2 * 2 + Send {Enter} ; Online Menu + Sleep IntPhoneMenuDelay2 + Send {Up 4} + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Session Menu + Sleep IntPhoneMenuDelay2 + Send {Down} + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Invite Only Session + Sleep IntPhoneMenuDelay2 + Send {Enter} ; Confirm Session Change + return + +; Join a New Crew Only Session +NewCrewSession: + turnCapslockOff() + SoundPlay, %A_WinDir%\Media\Windows Battery Critical.wav + Send {%IGB_Pause%} + ; Necessary delay to allow pause menu to open properly + Sleep, IntPhoneMenuDelay2 + Send {Right} + Sleep IntPhoneMenuDelay2 * 2 + Send {Enter} ; Online Menu + Sleep IntPhoneMenuDelay2 + Send {Up 4} + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Session Menu + Sleep IntPhoneMenuDelay2 + Send {Up 2} + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Crew Only Session + Sleep IntPhoneMenuDelay2 + Send {Enter} ; Confirm Session Change + return + +; Join a New Friend Only Session +NewFriendSession: + turnCapslockOff() + SoundPlay, %A_WinDir%\Media\Windows Battery Critical.wav + Send {%IGB_Pause%} + ; Necessary delay to allow pause menu to open properly + Sleep, IntPhoneMenuDelay2 + Send {Right} + Sleep IntPhoneMenuDelay2 * 2 + Send {Enter} ; Online Menu + Sleep IntPhoneMenuDelay2 + Send {Up 4} + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Session Menu + Sleep IntPhoneMenuDelay2 + Send {Up} + Sleep IntPhoneMenuDelay2 + Send {Enter} ; New Friend Only Session + Sleep IntPhoneMenuDelay2 + Send {Enter} ; Confirm Session Change return ; Show a list of chat snippets to type out (chat must be opened) @@ -938,6 +1110,20 @@ CallLester: dialNumber("346-555-0102", true) return +RemoveWantedLevel: + if (IsInBuilding) { + SplashTextOn 350 * WindowScale, 20 * WindowScale, Not Allowed, You cannot do this in a building + Sleep 2000 + SplashTextOff + bringGameIntoFocus() + } else { + ;makeCall(12, true) + dialNumber("346-555-0102", true) + sleep 8500 + Send {%IGB_Down%}{%IGB_Enter%}{%IGB_Interaction%} + } + return + CallAssistant: dialNumber("346-555-0137", true) return diff --git a/Macro Quick Reference.xlsx b/Macro Quick Reference.xlsx new file mode 100644 index 0000000..1e52b20 Binary files /dev/null and b/Macro Quick Reference.xlsx differ diff --git a/README.md b/README.md index 74d8155..972b932 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,40 @@ # GTA V Online AHK-Macros +Provides hotkeys for many parts of the Interaction and Settings menus. -Provides hotkeys for several useful features in GTA V:Online, see list further down. - - -**NOTE**: I tested this on my SC installation and with my account. If something doesn't work, ask (open issue)! - I evidently do heists most of the time so if you have ideas for useful CEO macros, let me know - or just send them in! - - -**GTAO 1.67 NOTE**: VIP/CEO mode is apparently no longer needed. Cayo mode possibly broken, I cannot currently test. Thanks to @vCybah for providing 1.67 fixes - +**GTAO 1.69 NOTE**: This is a nearly complete re-write of 2called-chaos' [script](https://github.com/2called-chaos/gtav-online-ahk) for GTA Online v1.69 (Bottom Dollar Bounties DLC). ## Requirements - * [AutoHotkey](https://www.autohotkey.com/) - * [pssuspend.exe and pskill.exe](https://docs.microsoft.com/en-us/sysinternals/downloads/pssuspend) in your path (for force disconnect and process killing, see instructions below) - + * [pssuspend.exe and pskill.exe](https://docs.microsoft.com/en-us/sysinternals/downloads/pssuspend) in your path (for force disconnect and process killing, see instructions below). This is only required for the Force Disconnect and Kill Game keys. ## Installation + * Download the .ahk files + * Open config.ahk in a text editor (e.g. notepad++ with AutoIT syntax highlighting) + * Change the hotkeys ([key list](https://www.autohotkey.com/docs/KeyList.htm)) and other options as you desire. - * Download the .ahk file - * Open it in a text editor (e.g. notepad++ with AutoIT syntax highlighting) - * Consider creating a config.ahk and copy lines you want to change over there (so you can update, see Config further down) - * Change the hotkeys ([key list](https://www.autohotkey.com/docs/KeyList.htm)) and other options as you desire - * Doubleclick the .ahk file (open with AHK) Note: On Windows 10 right click -> run as admin might be necessary - - -## Installation (pssuspend.exe / pskill.exe) - +## Optional Installation (pssuspend.exe / pskill.exe) pssuspend.exe and pskill.exe are tools from the sysinternals collection. You can download the whole package (~3MB) [directly from Microsoft](https://docs.microsoft.com/en-us/sysinternals/downloads/pssuspend). -You can copy them all but we only need pssuspend and pskill so go ahead and extract/copy `pssuspend.exe` `pskill.exe` to ANY of the following: - +You can copy them all but we only need pssuspend and pskill, so go ahead and extract/copy `pssuspend.exe` `pskill.exe` to ANY of the following: * into the same location where the .ahk file is * C:\Windows * C:\Windows\system32 **NOTE:** Start the pssuspend.exe AND pskill.exe once by double clicking on it and accept the license agreement or it will silently fail. - ## Usage - -* On Windows 10 you might have to start the AHK script as administrator (right click -> Run as administator) -* You should run the game in window(ed fullscreen) or some functions will alt-tab you and will not work properly -* You will have to toggle VIP/CEO/MC mode manually since the interaction menu will be changed and most functions need to be aware of that. -* Doesn't work well inside apartments, maybe in CEO mode while not being one (menu changes) +* Start GTA V before starting this script. +* On Windows 10/11 you have to start the `GTA V Online Macros.ahk` script as administrator (Right-click -> Run as administator). +* You should run the game in window(ed fullscreen) or some functions will switch windows and not work properly. +* You will have to toggle In Building mode (*) manually since the interaction menu will be changed and most functions need to be aware of that. When you go into a building, toggle this setting for the functions to work correctly. If you start in a building, toggle In Building mode before using any of the functions. As a quick reference, if the Interaction Menu has 11 options, In Building should be deactivated; if it has 12, activate it. This also needs to be toggled for some missions (i.e. Auto Shop Contracts). * The interaction menu is often delayed the first time it's opened after loading screens or cutscenes. - Make sure to briefly open the interaction menu from time to time, escpecially after loading/cutscenes. + Make sure to briefly open the interaction menu (m) from time to time, especially after loading/cutscenes. Alternatively you can increase the IntMenuDelay setting for more accuracy but making the process slower in general. -* Needless to say, don't give inputs while a macro is running or it might do random shit -* Sometimes you might find that the script doesn't appear to do anything. This might happen if you start - the game after the AHK script. Reloading it (right click on systray icon -> reload script) fixes that usually. - - -## Config - -You can (optionally) create a file `config.ahk` in the same location as the main script to overwrite settings without needing -to change the main file making updates easier. You can include any or all settings in the top of the script. - -```ahk -SnackMenuKey := "F12" ; change a single key bind - -; add a chat snippet -ArrayChatSnippets.push("Hey there!") - -; start with a clear list (discard default snippets by clearing array) -ArrayChatSnippets := [] -ArrayChatSnippets.push("The one and only snippet!") - -; custom keybind, see custom additions (if you want all your keybind settings in one place) -Hotkey, ^F6, ExampleMacro -``` +* If you start the game as CEO/President, you need to use the ResignOrDisband key (F9) and then become CEO/President again for the CEO/President functions to work correctly the first time. +* Needless to say, don't give inputs while a macro is running. +* Sometimes you might find that the script doesn't appear to do anything. This might happen if you start the game after the AHK script. Reloading the script (Right-click on AHK systray icon -> Reload Script) fixes that usually. ## Custom additions - -You can (optionally) create a file `custom.ahk` in the same location as the main script to add custom macros without needing -to change the main file making updates easier. +You can (optionally) create a file `custom.ahk` in the same location as the main script to add custom macros without needing to change the main file making updates easier. ```ahk ; directly bind onto a key with double-colons @@ -107,75 +67,84 @@ ExampleMacro: return ``` - ## Updates - Since v1.2.0 the script includes a simple auto updater. By default it will check for a new version on GitHub every time you launch the script. If a new (or actually different) version is found it will prompt you to proceed or cancel. -See the readme section about using config.ahk if you plan on changing settings as the update will replace the main script file! +Use config.ahk if you plan on changing settings as the update will replace the main script file! You can disable the automatic check and/or bind a manual check to a hotkey in the configuration (`DoCheckForUpdates` and `CheckForUpdatesKey`). Note that the update check hotkey still only works when GTA is active. - ## Will I get banned? - -I'm not aware of any bans issued by Rockstar following the usage of AHK-scripts. I personally use AHK-scripts within -GTA:O since 2014 and did not get banned. This is also not the only AHK-script available, I'm sure many are using them. -At the end it's your call but I'm 99% certain that it wont get you banned. - +I'm not aware of any bans issued by Rockstar following the usage of AHK-scripts. I have personally used AHK-scripts within GTA:O since 2014 and did not get banned. This is also not the only AHK-script available, I'm sure many are using them. At the end, it's your call but I'm 99% certain that it won't get you banned. ## Available macros - -I might forget to update so just check available keybinds :) +I might forget to update so just check available keybinds in config.ahk :) * **SnackMenu** – Opens the snack menu * **AutoHealth** – Consumes 2 snacks (from position 2) and closes menu * **ArmorMenu** – Opens the armor menu * **AutoArmor** – Consumes one super heavy armor and closes menu + * **RetrieveCar** – Retrieve your current active personal vehicle -* **TogglePassive** – Toggle passive mode -* **EquipScarf** – Equip scarf (heist outfit speed, see miscellaneous) -* **CycleOutfit** – Cycle through your saved outfits -* **ToggleVIP** – Toggle VIP(/CEO/MC) mode -* **ToggleCPH** – Toggle CPH (Cayo Perico Heist Final) mode -* **ToggleAFK** – Toggle AFK mode -* **ToggleClicker** – Toggle auto clicker -* **ToggleRadar** – Toggle extended radar -* **ToggleAutoHeli** – Keeps throttle and pitch forward pressed, poor mans autopilot +* **ReturnCar** - Return the currently active personal vehicle * **CEOBuzzard** – Spawn a free CEO Buzzard * **RequestSparrow** – Call in your Sparrow (or whatever you last requested moon pool vehicle was) -* **ReturnSparrow**: – Return your Sparrow to the Kosatka -* **RandomHeist** – Join a random heist (on-call) solo aka don't invite friends in session +* **ReturnSparrow** – Return your Sparrow to the Kosatka +* **RequestKosatka** - Call in your Kosatka Submarine +* **RequestOppressor** - Call in your Oppressor Mk II + * **ForceDisconnect** – Force disconnect the game by freezing the process for 10 seconds (requires pssuspend.exe) * **KillGame** – Kill the game process immediately (requires pskill.exe) + +* **ToggleInBuilding** – Toggle In a Building mode +* **ToggleAFK** – Toggle AFK mode + +* **TurnOnCEO** - Makes you CEO of an Organization and toggles VIP mode +* **TurnOnPres** - Makes you President of a MC Club and toggles VIP mode +* **ResignOrDisband** - Resigns your CEO position or Disbands your MC Club and toggles VIP mode + +* **TogglePassive** – Toggle passive mode +* **ToggleRadar** – Toggle extended radar +* **ToggleClicker** – Toggle auto clicker + +* **ToggleAutoHeli** – Keeps throttle and pitch forward pressed, poor mans autopilot +* **ToggleAutoPlane** - Keeps throttle at max for plane autopilot + * **ChatSnippets** – Select a sentence from a configurable list which will get typed out in the game (chat should already be open) + +* **CreateManualSave** - Use the outfit selection to create a manual save (doesn't change outfits) +* **CycleOutfit** – Cycle through your saved outfits +* **EquipScarf** – Equip scarf (heist outfit speed, see miscellaneous) + +* **NewPublicSession** - Join a New Public Session +* **NewInviteSession** - Join a New Invite Only Session +* **NewCrewSession** - Join a New Crew Only Session +* **NewFriendSession** - Join a New Friend Only Session + +* **RandomHeist** – Join a random heist (on-call) solo aka don't invite friends in session + * **DialDialog** – Select a number from a list and call it automatically (add items, change order or remove entries in config) -* **CheckForUpdates** – Manually check for updates The following calls can be directly bound to a hotkey (adding more is trivial): - -* **CallAssistant** -* **CallInsurance** -* **CallLester** * **CallMechanic** -* **CallMerryweather** * **CallPegasus** +* **CallMerryweather** +* **CallInsurance** +* **CallLester** +* **RemoveWantedLevel** - Calls Lester and has him remove wanted level +* **CallAssistant** You can reach more (useful or useless contacts) by binding `DialDialog` +* **CheckForUpdates** – Manually check for updates ## Miscellaneous - #### modifier keys for hotkeys - -If it's not clear enough from the key list. You can use [these symbols](https://autohotkey.com/docs/Hotkeys.htm#Symbols) in -combination with keys. For example `F1` to equip armor and `+F1` (shift+F1) to just open the menu. +If it's not clear enough from the key list. You can use [these symbols](https://autohotkey.com/docs/Hotkeys.htm#Symbols) in combination with keys. For example `F1` to equip armor and `+F1` (shift+F1) to just open the menu. #### "cheat codes" - -With AHK's hotstrings you could achieve something like the good old cheat codes to trigger macros. -The issue is just to find words that won't trigger things like chat or the interaction menu. +With AHK's hotstrings you could achieve something like the good old cheat codes to trigger macros. The issue is just to find words that won't trigger things like chat or the interaction menu. ```ahk ::lester:: @@ -183,27 +152,18 @@ The issue is just to find words that won't trigger things like chat or the inter return ``` -This would allow you (in theory) to type "lester" followed by a TAB to trigger the macro. But again, -`t` would open the chat usually and break the macro. +This would allow you (in theory) to type "lester" followed by a TAB to trigger the macro. But again, `t` would open the chat usually and break the macro. #### Scarf / Heist outfit - -Yo, what's up with the scarf macro? Well if you have played normal heists with the heavy outfit once -you know that you are slower but take less damage with them. Given that you play with a player saved -heist outfit and own a scarf you can get rid of the armor and its speed effect while still keeping -the protective aspects of it. +Yo, what's up with the scarf macro? Well if you have played normal heists with the heavy outfit once you know that you are slower but take less damage with them. Given that you play with a player saved heist outfit and own a scarf you can get rid of the armor and its speed effect while still keeping the protective aspects of it. [![gif](https://i.imgur.com/YbD6MJa.gif)](https://imgur.com/OI1g0Xz) -Just beware: Some cutscenes may remove the protective effect, quick-restart most certainly will remove -the effect and some checkpoints will give you the armor back (visibly) and some wont. If you get the armor -back you can repeat the scarf equip, otherwise no heist outfit for the rest of the mission. +Just beware: Some cutscenes may remove the protective effect, quick-restart most certainly will remove the effect and some checkpoints will give you the armor back (visibly) and some wont. If you get the armor back you can repeat the scarf equip, otherwise no heist outfit for the rest of the mission. I use it for example for the Pacific finale and equip the scarf after leaving the bank. - ## Contributing - Contributions are very welcome! Either report errors, bugs and propose features or directly submit code: 1. Fork it @@ -212,8 +172,7 @@ I use it for example for the Pacific finale and equip the scarf after leaving th 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request - Please use spaces for indentation and try to mimic the style off existing code :) + Please use spaces for indentation and try to mimic the style of existing code :) ## Legal - This repository is licensed under the MIT license. diff --git a/config.ahk b/config.ahk new file mode 100644 index 0000000..0f583f8 --- /dev/null +++ b/config.ahk @@ -0,0 +1,66 @@ +SnackMenuKey := "+F1" ; Open Snack menu (+ = shift, rtfm). +AutoHealthKey := "F1" ; Automatic snacking. Eats 2 snacks from second snack slot. +ArmorMenuKey := "+F2" ; Open Armor menu. +AutoArmorKey := "F2" ; Automatic armor equip (uses super heavy armor only). + +RetrieveCarKey := "F5" ; Request currently active Personal Vehicle. +ReturnCarKey := "+F5" ; Return the currently active Personal Vehicle. +CEOBuzzardKey := "^F3" ; Spawn free CEO buzzard. +RequestSparrowKey := "F3" ; Call in your Sparrow (or whatever you last requested moon pool vehicle was). +ReturnSparrowKey := "+F3" ; Return your Sparrow to the Kosatka. +RequestKosatkaKey := "F4" ; Call in your Kosatka Submarine. +RequestOppressorKey := "+F4" ; Call in your Oppressor Mk II. + +ForceDisconnectKey := "F12" ; Force disconnect by suspending process for 10s, requires pssuspend.exe. +KillGameKey := "+F12" ; Kill game process, requires pskill.exe. + +ToggleInBuildingKey := "NumpadMult" ; Toggle In a Building mode. +ToggleCPHKey := "^NumpadMult" ; Toggle Cayo Perico Heist mode. +ToggleAFKKey := "+NumpadMult" ; Toggle AFK mode. + +TurnOnCEOKey := "+F9" ; Makes you CEO of an Organization and toggles VIP mode. +TurnOnPresKey := "^F9" ; Makes you President of a MC Club and toggles VIP mode. +ResignOrDisbandKey := "F9" ; Resigns your CEO position or Disbands your MC Club and toggles VIP mode. + +TogglePassiveKey := "F10" ; Toggle passive mode. +ToggleRadarKey := "F24" ; Toggle between extended and standar radar. +ToggleClickerKey := "F24" ; Toggle Clicker (XButton2 = Mouse5). + +ToggleAutoHeliKey := "+F6" ; Keeps throttle and pitch forward pressed, First take heli to sufficient height and then use this as autopilot. +ToggleAutoPlaneKey := "F6" ; Keeps throttle at max for plane autopilot. + +ChatSnippetsKey := "F24" ; Gives you a few text snippets to put in chat (chat must be already open). + +CreateManualSaveKey := "F7" ; Use the outfit selection to create a manual save (doesn't change outfits). +CycleOutfitKey := "+F7" ; Equip next/cycle through saved outfits. +EquipScarfKey := "F24" ; Equip first scarf (heist outfit glitch, see readme/misc). + +NewPublicSessionKey := "^F11" ; Join a New Public Session +NewInviteSessionKey := "F11" ; Join a New Invite Only Session. +NewCrewSessionKey := "F24" ; Join a New Crew Only Session. +NewFriendSessionKey := "+F11" ; Join a New Friend Only Session. + +RandomHeistKey := "F24" ; Chooses on-call random heist from phone options. + +DialDialogKey := "^F8" ; Call GUI with a list of almost all numbers. +CallMechanicKey := "^F5" ; Call Mechanic. +CallPegasusKey := "F24" ; Call Pegasus. +CallMerryweatherKey := "F24" ; Call Merryweather. +CallInsuranceKey := "F24" ; Call Insurance. +CallLesterKey := "+F8" ; Call Lester. +RemoveWantedLevelKey := "F8" ; Call Lester and have him remove wanted level. +CallAssistantKey := "F24" ; Call Assistant. + +CheckForUpdatesKey := "F24" ; Checks on startup by default, see DoCheckForUpdates option. + +AutoSnackLocation := 2 ; by default this is the snack that autosnack will select. +AutoArmorLocation := 5 ; by default this is Super Heavy Armor, but can be changed. + +; Options (should be fine out of the box) +WindowScale := 1.0 ; Change this to reflect your Windows display scale (e.g. set it to 3 if you have UI scale set to 300%). +DoConfirmKill := true ; If true the KillGame action will ask for confirmation before killing the process. +DoConfirmDisconnect := true ; If true the ForceDisconnect action will ask for confirmation before suspending the process. +IntDisconnectDelay := 10 ; Amount of seconds to freeze the process for, 10 works fine. +DoToggleCPHWithVIP := false ; If true ToggleVIP will become a 3-way toggle (off/on/CayoPericoHeistFinal). +DisableCapsOnAction := true ; Disable caps lock before executing macros, some macros might fail if caps lock is on. +DoCheckForUpdates := true ; Check for script updates on startup (you can manually bind this instead or additionally).