Advertisement
iCake-

GTA Online Speed Dial & Quick Snacks/Armor

Nov 1st, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; GTA Online macros to apply armor, eat a snack, speed dial contacts and quickly toggle passive mode.
  2. ; Original script by RocketGrouch, modified and expanded by Anon.
  3.  
  4. ; Basic settings and such for AHK
  5.  
  6. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  7. #Warn ; common errors
  8. #SingleInstance force
  9. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  10. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  11. SetTitleMatchMode, 2 ; Necessary to match on the name of the window instead of window class in IfWinActive.
  12.  
  13. ; shift+control+alt+r becomes a hotkey to reload this script. For me it is necessary to
  14. ; reload it after starting the game - with the hotkey I can do it without ever going to
  15. ; the desktop. Please note if you have any other program that uses this particular long
  16. ; key combo this will replace it througout your Windows.
  17.  
  18. +^!r::Reload ; Assign Shift-Ctrl-Alt-R as a hotkey to restart the script.
  19.     Sleep 1000 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached.
  20.     MsgBox, 4,, The script could not be reloaded. Would you like to open it for editing?
  21.     IfMsgBox, Yes, Edit
  22. return
  23.  
  24. ; Grand Theft Auto V / Online specific macros begin here. Everything below the IfWinActive statement
  25. ; only happens if the GTA window is open and on top.
  26.  
  27. #IfWinActive Grand Theft Auto V
  28.  
  29. ; Why all these manual pauses and explicitly specifying both button press and button release,
  30. ; when I could be using SetKeyDelay? Because I couldn't get SetKeyDelay to work reliably in
  31. ; GTAO. This may be ugly, but if it's ugly and works perfectly its good enough for me.
  32.  
  33. ; I made the steps into gosubs, just to make the actual macros below more readable and easy
  34. ; to edit. If your computer can handle even faster menu interaction, change the 60 in the
  35. ; Sleep statements to 50 or less. You'll probably start seeing lower reliability.
  36.  
  37. Down:
  38.     Send {Down down}
  39.     Sleep, 60
  40.     Send {Down up}
  41.     Sleep, 60
  42. Return
  43.  
  44. Right:
  45.     Send {Right down}
  46.     Sleep, 60
  47.     Send {Right up}
  48.     Sleep, 60
  49. Return
  50.  
  51. Up:
  52.     Send {up down}
  53.     Sleep, 60
  54.     Send {up up}
  55.     Sleep, 60
  56. Return
  57.  
  58. Enter:
  59.     Send {Enter down}
  60.     Sleep, 60
  61.     Send {Enter up}
  62.     Sleep, 60
  63. Return
  64.  
  65. Menu:
  66.     Send {M down}
  67.     Sleep, 60
  68.     Send {M up}
  69. Return
  70.  
  71. Phone:
  72.     Send {up down}
  73.     Sleep, 60
  74.     Send {up up}
  75. Return
  76.  
  77. ; I use several keys on the Numpad to activate these macros.
  78. ; See https://www.autohotkey.com/docs/KeyList.htm if you need
  79. ; to find other keys. Also note that some of these don't work inside apartments.
  80.  
  81. ; 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
  82. ; for equiping armor or eating a snack in these different modes. I have configured it like this because
  83. ; the interaction menu changes depending on if you are registered or not.
  84.  
  85. ; NumLock ON if you are registered as a MC/CEO, NumLock OFF if you are not registered!
  86. ; Switching to the corresponding NumLock state is not required for Speed Dials to phone contacts.
  87.  
  88. NumpadDel:: ; Super Heavy Armor SOLO
  89.     Gosub, Menu
  90.     Sleep, 250 ; Short delay to let the menu open properly
  91.     Gosub, Down
  92.     Gosub, Enter
  93.     Gosub, Down
  94.     Gosub, Enter
  95.     Gosub, Up
  96.     Gosub, Up
  97.     Gosub, Up
  98.     Gosub, Enter
  99.     Gosub, Menu
  100. return
  101.  
  102. NumpadIns:: ; Snack Cycle SOLO
  103.     Gosub, Menu
  104.     Sleep, 250
  105.     Gosub, Down
  106.     Gosub, Enter
  107.     Gosub, Down
  108.     Gosub, Down
  109.     Gosub, Enter
  110.     Gosub, Down
  111.     Gosub, Enter
  112.     Gosub, Menu
  113. return
  114.  
  115. NumpadDot:: ; Super Heavy Armor MC/CEO
  116.     Gosub, Menu
  117.     Sleep, 250
  118.     Gosub, Down
  119.     Gosub, Down
  120.     Gosub, Enter
  121.     Gosub, Down
  122.     Gosub, Enter
  123.     Gosub, Up
  124.     Gosub, Up
  125.     Gosub, Up
  126.     Gosub, Enter
  127.     Gosub, Menu
  128. return
  129.  
  130. Numpad0:: ; Snack Cycle MC/CEO
  131.     Gosub, Menu
  132.     Sleep, 250
  133.     Gosub, Down
  134.     Gosub, Down
  135.     Gosub, Enter
  136.     Gosub, Down
  137.     Gosub, Down
  138.     Gosub, Enter
  139.     Gosub, Down
  140.     Gosub, Enter
  141.     Gosub, Menu
  142. return
  143.  
  144. NumpadDown:: ; Pegasus ALL Numlock OFF
  145.     Gosub, Phone
  146.     Sleep, 550 ; Bringing up the phone requires a slightly longer delay
  147.     Gosub, Up
  148.     Gosub, Right
  149.     Gosub, Enter
  150.     Gosub, Up
  151.     Sleep, 40 ; Navigating through the contacts list requires a bit more delay for all inputs to register
  152.     Gosub, Up
  153.     Sleep, 40
  154.     Gosub, Up
  155.     Gosub, Enter
  156. return
  157.  
  158. Numpad2:: ; Pegasus ALL Numlock ON
  159.     Gosub, Phone
  160.     Sleep, 550
  161.     Gosub, Up
  162.     Gosub, Right
  163.     Gosub, Enter
  164.     Gosub, Up
  165.     Sleep, 40
  166.     Gosub, Up
  167.     Sleep, 40
  168.     Gosub, Up
  169.     Gosub, Enter
  170. return
  171.  
  172. NumpadEnd:: ; Mechanic ALL Numlock OFF
  173.     Gosub, Phone
  174.     Sleep, 550
  175.     Gosub, Up
  176.     Gosub, Right
  177.     Gosub, Enter
  178.     Gosub, Up
  179.     Sleep, 40
  180.     Gosub, Up
  181.     Sleep, 40
  182.     Gosub, Up
  183.     Sleep, 40
  184.     Gosub, Up
  185.     Sleep, 40
  186.     Gosub, Up
  187.     Sleep, 40
  188.     Gosub, Up
  189.     Gosub, Enter
  190. return
  191.  
  192. Numpad1:: ; Mechanic ALL Numlock ON
  193.     Gosub, Phone
  194.     Sleep, 550
  195.     Gosub, Up
  196.     Gosub, Right
  197.     Gosub, Enter
  198.     Gosub, Up
  199.     Sleep, 40
  200.     Gosub, Up
  201.     Sleep, 40
  202.     Gosub, Up
  203.     Sleep, 40
  204.     Gosub, Up
  205.     Sleep, 40
  206.     Gosub, Up
  207.     Sleep, 40
  208.     Gosub, Up
  209.     Gosub, Enter
  210. return
  211.  
  212. NumpadPgDn:: ; Insurance ALL Numlock OFF
  213.     Gosub, Phone
  214.     Sleep, 550
  215.     Gosub, Up
  216.     Gosub, Right
  217.     Gosub, Enter
  218.     Gosub, Up
  219.     Sleep, 40
  220.     Gosub, Up
  221.     Sleep, 40
  222.     Gosub, Up
  223.     Sleep, 40
  224.     Gosub, Up
  225.     Gosub, Enter
  226. return
  227.  
  228. Numpad3:: ; Insurance ALL Numlock ON
  229.     Gosub, Phone
  230.     Sleep, 550
  231.     Gosub, Up
  232.     Gosub, Right
  233.     Gosub, Enter
  234.     Gosub, Up
  235.     Sleep, 40
  236.     Gosub, Up
  237.     Sleep, 40
  238.     Gosub, Up
  239.     Sleep, 40
  240.     Gosub, Up
  241.     Gosub, Enter
  242. return
  243.  
  244. NumpadLeft:: ; Lester ALL Numlock OFF
  245.     Gosub, Phone
  246.     Sleep, 550
  247.     Gosub, Up
  248.     Gosub, Right
  249.     Gosub, Enter
  250.     Gosub, Up
  251.     Sleep, 40
  252.     Gosub, Up
  253.     Sleep, 40
  254.     Gosub, Up
  255.     Sleep, 40
  256.     Gosub, Up
  257.     Sleep, 40
  258.     Gosub, Up
  259.     Sleep, 40
  260.     Gosub, Up
  261.     Sleep, 40
  262.     Gosub, Up
  263.     Sleep, 40
  264.     Gosub, Up
  265.     Sleep, 40
  266.     Gosub, Up
  267.     Gosub, Enter
  268. return
  269.  
  270. Numpad4:: ; Lester ALL Numlock ON
  271.     Gosub, Phone
  272.     Sleep, 550
  273.     Gosub, Up
  274.     Gosub, Right
  275.     Gosub, Enter
  276.     Gosub, Up
  277.     Sleep, 40
  278.     Gosub, Up
  279.     Sleep, 40
  280.     Gosub, Up
  281.     Sleep, 40
  282.     Gosub, Up
  283.     Sleep, 40
  284.     Gosub, Up
  285.     Sleep, 40
  286.     Gosub, Up
  287.     Sleep, 40
  288.     Gosub, Up
  289.     Sleep, 40
  290.     Gosub, Up
  291.     Sleep, 40
  292.     Gosub, Up
  293.     Gosub, Enter
  294. return
  295.  
  296. NumpadClear:: ; Merryweather ALL Numlock OFF
  297.     Gosub, Phone
  298.     Sleep, 550
  299.     Gosub, Up
  300.     Gosub, Right
  301.     Gosub, Enter
  302.     Gosub, Up
  303.     Sleep, 40
  304.     Gosub, Up
  305.     Sleep, 40
  306.     Gosub, Up
  307.     Sleep, 40
  308.     Gosub, Up
  309.     Sleep, 40
  310.     Gosub, Up
  311.     Gosub, Enter
  312. return
  313.  
  314. Numpad5:: ; Merryweather ALL Numlock ON
  315.     Gosub, Phone
  316.     Sleep, 550
  317.     Gosub, Up
  318.     Gosub, Right
  319.     Gosub, Enter
  320.     Gosub, Up
  321.     Sleep, 40
  322.     Gosub, Up
  323.     Sleep, 40
  324.     Gosub, Up
  325.     Sleep, 40
  326.     Gosub, Up
  327.     Sleep, 40
  328.     Gosub, Up
  329.     Gosub, Enter
  330. return
  331.  
  332. NumpadEnter:: ; Passive SOLO
  333.     Gosub, Menu
  334.     Sleep, 250
  335.     Gosub, Up
  336.     Gosub, Enter
  337.     Gosub, Menu
  338. return
  339.  
  340. #IfWinActive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement