-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgta5.ahk
203 lines (179 loc) · 4.53 KB
/
gta5.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
; GTA Online macros to apply armor, eat a snack or toggle passive.
; 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
Up:
Send {up down}
Sleep, 60
Send {up up}
Sleep, 60
Return
Enter:
Send {Enter down}
Sleep, 60
Send {Enter up}
Sleep, 60
Return
Esc:
Send {Esc down}
Sleep, 60
Send {Esc up}
Sleep, 60
Return
Menu:
Send {M down}
Sleep, 60
Send {M up}
Return
; I use the 0 key on the numpad, the dot on the numpad and the + 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 these don't work inside apartments or in any situation
; where the menu changes, like when you become a VIP.
Numpad4:: ; Apply ceo armor
Gosub, Menu
Sleep, 250 ; Extra long sleep just to make sure the menu has time to appear properly.
Gosub, Down
Gosub, Down
Gosub, Enter
Gosub, Down
Gosub, Enter
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Enter
Gosub, Menu
return
Numpad5:: ; open ceo snack
Gosub, Menu
Sleep, 250
Gosub, Down
Gosub, Down
Gosub, Enter
Gosub, Down
Gosub, Down
Gosub, Enter
return
NumpadAdd:: ; ceo buzzard spawn!
Gosub, Menu
Sleep, 250
Gosub, Enter
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Enter
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Enter
return
Numpad1:: ; Apply normal armor
Gosub, Menu
Sleep, 250 ; Extra long sleep just to make sure the menu has time to appear properly.
Gosub, Down
Gosub, Enter
Gosub, Down
Gosub, Enter
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Down
Gosub, Enter
Gosub, Menu
return
Numpad2:: ; Eat a normal snack. This will cycle through them as they run out.
Gosub, Menu
Sleep, 250
Gosub, Down
Gosub, Enter
Gosub, Down
Gosub, Down
Gosub, Enter
return
+p::
SetTimer, AFK, 300000
Gosub, AFK
return
+s::
SetTimer, AFK, Off
return
AFK:
Gosub, Menu
return
Numpad8:: ; Auto-outfit an X80 Proto export vehicle
; tracker
Gosub, Enter
Gosub, Enter
; plate
Gosub, Enter
Gosub, Down
Gosub, Enter
Gosub, Esc
Gosub, Enter
; respray
Gosub, Enter
Gosub, Enter
Gosub, Down
Gosub, Enter
Gosub, Down ; could be random from 0-10
Gosub, Enter
Gosub, Esc
Gosub, Esc
Gosub, Esc
Gosub, Enter
; performance upgrades
Gosub, Enter
Gosub, Enter
; chassis
Gosub, Enter
Gosub, Enter
Gosub, Up
Gosub, Enter
Gosub, Esc
Gosub, Esc
Gosub, Enter
; wheels
Gosub, Enter
Gosub, Enter
Gosub, Enter
Gosub, Enter
Gosub, Down ; could be random from 0-10
Gosub, Enter
Gosub, Esc
Gosub, Esc
Gosub, Esc
Gosub, Esc
Gosub, Enter
return
#IfWinActive