forked from PProvost/AutoHotKey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFPS-Helpers.ahk
403 lines (351 loc) · 9.02 KB
/
FPS-Helpers.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
#SingleInstance
#NoEnv
;------#COD TOOLBOX#-----------------------------------------------
;Last updated 13/11/2010
;Script by Zygorator
;Original crosshair script by guest and master131
;------------------------------------------------------------------
;------------------------------------------------------------------
;Add your games window class name to this list to activate the script for that game
;------#GAMES#--------------------------------------------------
GroupAdd,gamewindow ,ahk_class CoD4 ;COD 4: MW
GroupAdd,gamewindow ,ahk_class CoD-WaW ;COD 5: WAW
GroupAdd,gamewindow ,ahk_class IW4 ;COD 6: MW2
GroupAdd,gamewindow ,ahk_class CoDBlackOps ;COD 7: BO
GroupAdd,gamewindow ,ahk_class IW5 ; COD 8: MW3
;------------------------------------------------------------------
#IfWinActive ahk_group gamewindow
;------#INFO#------------------------------------------------------
; Remember to set your game to run in windowed mode and restart if you want to show crosshair (and alt-tab out while dead)
; The script will automatically maximize and remove borders from the game so it works completely like fullscreen mode
; Punkbuster seems to hate overlays
; There are three different fire modes:
; 1) Single gun rapidfire
; 2) Akimbo/Dual Wield rapidfire
; 3) Burst fire
;------------------------------------------------------------------
;All keys behave as normal when game window is not at the front.
;------#BINDINGS#--------------------------------------------------
anim_cancel = < ;Animation canceling for faster reload.
switch_mode = Insert ;Switch between fire modes
crosshair = Delete ;Toggle the crosshair
burst_down = NumpadSub ;Lower amount of bullets fired in burst mode (different weapons have different firerates)
burst_up = NumpadAdd ;Raise amount of bullets fired in burst mode (you might need to raise/lower this more than once just to add/remove one bullet in the burst)
recoil_toggle = End ;Toggle recoil compensation
recoil_up = PgUP ;Increase recoil compensation (how many pixels it moves each time it is run)
recoil_down = PgDn ;Decrease recoil compensation
quick_knife = - ;Does a very very fast knife attack, around double the speed of tact. knife
;Note: Do not use with anything but Tomahawk/Throwing knife(MW2)/C4(MW2)
;There is a miniscule chance that you'r equipment will bork and knife will fail.
;It is spammable (almost) without fail with almost every weapon in BO. In MW2 stick to pistols and G18 Akimbo with it.
;------------------------------------------------------------------
;Firerates in miliseconds. Lower is faster. Default should work fine, but some servers might kick when this low.
;For optimal results, set it close to the firerate of a specific gun (this will of course make it less optimal for other guns.)
;------#FIRERATES#-------------------------------------------------
firerate_1 = 85 ;Mode 1
firerate_2 = 25 ;Mode 2
firerate_3 = 85 ;Mode 3
;------------------------------------------------------------------
;Crosshair colour in base16
;------#CROSSHAIR SETTINGS#----------------------------------------
red = 00
green = FF
blue = 00
;------------------------------------------------------------------
;Don't change these unless you know what you're doing:
;------#OTHER VARIABLES#-------------------------------------------
melee = v
equip = g
switch_weapon = 1
window_title = ahk_group gamewindow
finalcolor = 0x00%blue%%green%%red%
fire = LButton
rcoil := 3
rcoil_on := 0
fullscreen := 0
max_burst := 20
max_recoil := 20
fire_mode := 0
looptime := 4
drawshit := 0
xpos := A_ScreenWidth/2
ypos := A_ScreenHeight/2
hDrwArea := DllCall("GetDC", "uint", Null)
;--------------------------------------------------------------
;Feel free to rage over incredible amounts of redundant code, my first script.
;--------------------------------------------------------------
Hotkey,~*%fire%,rapidfireLoop
Hotkey,~*%switch_mode%,doswitch_mode
Hotkey,~*%crosshair%,docrosshair
Hotkey,~*%burst_up%,doBurst_up
Hotkey,~*%burst_down%,doBurst_down
Hotkey,~*%recoil_down%,rcoildown
Hotkey,~*%recoil_up%,rcoilup
Hotkey,~*%recoil_toggle%,rcoiltoggle
Hotkey,~*%anim_cancel%,animcancel
; Hotkey,~*%quick_knife%, quickKnife
lazor:
Loop
{
WinWaitClose, %window_title%
{
fullscreen := 0
fire_mode := 0
Dontdraw()
drawshit := 0
}
WinWait, %window_title%
{
if not fullscreen = 1
{
WinActivate
fullscreen := 1
WinSet, Style, -0xC00000
WinMove, , , 0, 0
WinMaximize
}
}
sleep 10000
}
return
quickKnife:
doQuickKnife(melee,equip,switch_weapon)
doQuickKnife(v1,v2,v3) {
SendInput {%v1% Down}
Sleep 40
SendInput {%v1% Up}
Sleep 100
SendInput {%v2% Down}
Sleep 40
SendInput {%v3% Down}
Sleep 40
SendInput {%v2% Up}
Sleep 40
SendInput {%v3% Up}
Sleep 190
Return
}
animcancel:
{
SendInput {%switch_weapon%}
sleep 10
SendInput {%switch_weapon%}
sleep 100
}
return
doswitch_mode:
If fire_mode < 3
{
fire_mode += 1
if fire_mode = 1
{
SoundBeep, 600, 100
}
else if fire_mode = 2
{
SoundBeep, 800, 100
}
else if fire_mode = 3
{
SoundBeep, 1000, 100
}
}
else
{
fire_mode := 0
SoundBeep, 200, 100
SoundBeep, 200, 100
}
return
docrosshair:
If drawshit < 1
{
drawshit +=1
If drawshit = 1
{
Draw()
}
}
else
{
Dontdraw()
drawshit := 0
}
return
doBurst_down:
IfWinActive, %window_title%
{
if looptime > 1
{
SoundBeep, 650, 100
looptime -= 1
}
else
{
looptime = 1
SoundBeep, 650, 100
SoundBeep, 750, 100
}
}
return
doBurst_up:
if looptime < %max_burst%
{
SoundBeep, 450, 100
looptime += 1
}
else
{
looptime = %max_burst%
SoundBeep, 450, 100
SoundBeep, 550, 100
}
return
rcoildown:
if rcoil > 1
{
SoundBeep, 450, 100
rcoil -= 1
}
else
{
SoundBeep, 440, 100
rcoil = 1
}
return
rcoilup:
if rcoil < %max_recoil%
{
SoundBeep, 650, 100
rcoil += 1
}
else
{
SoundBeep, 650, 100
rcoil = %max_recoil%
}
return
rcoiltoggle:
if rcoil_on = 0
{
SoundBeep, 1200, 100
rcoil_on := 1
}
else
{
SoundBeep, 350, 100
rcoil_on := 0
}
return
recoil_reduction()
{
global
if rcoil_on = 1
{
MouseMove, 0, rcoil ,0 , r
}
}
return
rapidfireLoop:
if not fire_mode = 0
{
Loop
{
GetKeyState, LButtonState, LButton, P
if fire_mode = 1
{
Click
recoil_reduction()
sleep, %firerate_1%
If LButtonState = U
{
break
}
}
else if fire_mode = 2
{
Click
recoil_reduction()
Sleep, %firerate_2%
Click right
Sleep, %firerate_2%
If LButtonState = U
{
break
}
}
else if fire_mode = 3
{
loop %looptime%
{
Click
recoil_reduction()
Sleep %firerate_3%
}
Sleep 20
break
}
else
{
break
}
}
}
else
{
if rcoil_on = 1
{
loop
{
sleep 60
recoil_reduction()
GetKeyState, LButtonState, LButton, P
If LButtonState = U
{
break
}
}
}
}
return
Draw()
{
SetTimer, SetPixel, 1
}
return
Dontdraw()
{
SetTimer, SetPixel, Off
}
return
SetPixel:
IfWinActive, %window_title%
{
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 2, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 2, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 3, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 3, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 2, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 2, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 3, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 3, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 4, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 4, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 4, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 4, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 5, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 5, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 5, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 5, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 6, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 6, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 6, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 6, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos - 7, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos, "int", ypos + 7, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos - 7, "int", ypos, "uint", finalcolor)
DllCall("SetPixel", "uint", hDrwArea, "int", xpos + 7, "int", ypos, "uint", finalcolor)
}
Return
; THE END?
; (yes)