-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPR Movement.ahk
217 lines (178 loc) · 2.96 KB
/
PR Movement.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
OnExit, ExitSub
#include %A_ScriptDir%\libs\CrouchToggle.ahk
#include %A_ScriptDir%\libs\JoyStick.ahk
#include Config.ahk
;Some stuff that is suggested to use, dont know why tbh
#NoEnv
#MaxHotkeysPerInterval 250
SendMode Input
;TitleMatchMode 1 = Window title begins with
SetTitleMatchMode 1
;Start timer
SetTimer, CheckWindow, 500
;Init
Init_CrouchToggle(CROUCH_KEY_INGAME)
Init_JoyStick(1)
Hotkey, ~*%CROUCH_KEY%, CrouchKey
Hotkey, ~*%PRONE_KEY%, Uncrouch
Hotkey, ~*%CONSOLE_KEY%, Uncrouch
Hotkey, ~*%ENTER_KEY%, Uncrouch
Hotkey, ~*%POS1_KEY%, Uncrouch
Hotkey, ~*%POS2_KEY%, Uncrouch
Hotkey, ~*%POS3_KEY%, Uncrouch
Hotkey, ~*%POS4_KEY%, Uncrouch
Hotkey, ~*%POS5_KEY%, Uncrouch
Hotkey, ~*%POS6_KEY%, Uncrouch
Hotkey, ~*%POS7_KEY%, Uncrouch
Hotkey, ~*%POS8_KEY%, Uncrouch
Hotkey, ~*%JUMP_KEY%, JumpKey
Hotkey, ~*%SQUAD_CHAT_KEY%, ChatKey
Hotkey, ~*%TEAM_CHAT_KEY%, ChatKey
Hotkey, ~*%ALL_CHAT_KEY%, ChatKey
Hotkey, *%SPRINT_KEY%, SprintKey
;Start as suspended
SuspendScript()
Return
;Check to see if PR window is active
CheckWindow:
WinWaitActive, %PRWIN_TITLE%, ,
if ErrorLevel = 0
{
Suspend, off
}
WinWaitNotActive, %PRWIN_TITLE%, ,
if ErrorLevel = 0
{
SuspendScript()
}
Return
;Let Alt+Tab deactivate the script
~!Tab::
SuspendScript()
Return
CrouchKey:
if(GetChatting() = 1)
Return
SendInput {%CROUCH_KEY_INGAME% down}
KeyWait, %CROUCH_KEY%
ToggleCrouch()
Return
Uncrouch:
SetCrouch(0)
Return
JumpKey:
SetCrouch(0)
if IsPilotMode() = 1
Hover()
Return
ChatKey:
SetChatting(1)
Return
~*W::
if IsPilotMode() = 1
{
while GetKeyState("W","P")
{
ThrottleUp()
Sleep, 20
}
}
else
ThrottleFwrd()
Return
~*W UP::
if IsPilotMode() = 0
ThrottleFwrdStop()
Return
~*S::
if IsPilotMode() = 1
{
while GetKeyState("S","P")
{
ThrottleDown()
Sleep, 20
}
}
else
ThrottleBwrd()
Return
~*S UP::
if IsPilotMode() = 0
ThrottleBwrdStop()
Return
~*D::
ThrottleRight()
Return
~*D UP::
ThrottleRightStop()
Return
~*A::
ThrottleLeft()
Return
~*A UP::
ThrottleLeftStop()
Return
~*LControl::
if IsPilotMode() = 0
EnableSpeedMod(1)
Return
~*LControl UP::
if IsPilotMode() = 0
EnableSpeedMod(0)
Return
LControl & WheelUp::
if IsPilotMode() = 0
IncreaseSpeedMod()
else
IncreaseHover()
Return
LControl & WheelDown::
if IsPilotMode() = 0
DecreaseSpeedMod()
else
DecreaseHover()
Return
~F11::
ResetJoystickPos()
if IsPilotMode() = 0
SetPilotMode(1)
else
SetPilotMode(0)
Return
~*Esc::
if GetChatting() = 0
{
ResetJoystickPos()
ResetCrouch()
Return
}
SetChatting(0)
Return
~*Enter::
~*NumpadEnter::
SetChatting(0)
Return
SprintKey:
SetCrouch(0)
SendInput {%SPRINT_KEY% up}
Sleep 30
SendInput {%SPRINT_KEY% Down}
KeyWait %SPRINT_KEY%
SendInput {%SPRINT_KEY% Up}
Return
SuspendScript()
{
ResetCrouch()
ResetJoystickPos()
;HideGui()
Suspend, on
}
GuiEscape:
GuiClose:
Exit:
ExitSub:
ResetCrouch()
ResetJoyStick()
VJoy_Close()
Gdip_Shutdown(pToken)
ExitApp