forked from thyaguster/NoRecoilApex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.ahk
309 lines (301 loc) · 12.2 KB
/
gui.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
#NoEnv
#SingleInstance force
#MaxThreadsBuffer on
SendMode Input
SetWorkingDir %A_ScriptDir%
DetectHiddenWindows On
SetTitleMatchMode RegEx
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
Gosub, IniRead
Gui, +Hwndgui_id
Gui, Show, %gui_position% w250 h100
Gui Show, w345 h400, No Recoil Script v2.3
Gui, Color, Grey
Gui, Font, cWhite
Gui, Font, s12
Gui Add, Text, x0 y8 w343 h20 Center, Apex Legends No Recoil Script v2.3
Gui, Font, s10
Gui Add, GroupBox, x18 y32 w190 h300, Hotkeys
Gui Add, GroupBox, x214 y32 w122 h70, Settings
Gui Add, Text, x32 y52 w89 h16, [ %key_akm% ] Prowler
Gui Add, Text, x32 y68 w86 h16, [ %key_m16a4% ] Hemlock
Gui Add, Text, x32 y84 w67 h16, [ %key_skspubg% ] Scout
Gui Add, Text, x32 y100 w63 h16, [ %key_uzi% ] R301
Gui Add, Text, x32 y116 w56 h16, [ %key_vector% ] R99
Gui Add, Text, x32 y132 w73 h16, [ %key_m416% ] Spitfire
Gui Add, Text, x32 y148 w75 h16, [ %key_scar% ] Flatline
Gui Add, Text, x32 y164 w56 h16, [ %key_ump% ] R45
Gui Add, Text, x32 y180 w89 h16, [ %key_groza% ] Alternator
Gui Add, Text, x32 y196 w76 h16, [ %key_glock% ] P2020
Gui Add, Text, x32 y212 w158 h16, [ %key_peacekeeper% ] Peacekeeper Glitch
Gui Add, Text, x32 y228 w158 h16, [ %key_m249% ] Havoc
Gui Add, Text, x32 y244 w158 h16, [ %key_tgun% ] Devotion
Gui Add, Text, x32 y266 w109 h16, [ %key_RCoff% ] Disable Script
Gui Add, Text, x32 y280 w111 h16, [ %key_Terminate% ] Close Script
Gui Add, Text, x32 y294 w140 h16, [ %key_pause% ] Pause Script
Gui Font, s8
Gui Add, Text, x43 y370 w300 h13, If you need help add me on discord: Aljubarrota#3579
Gui Add, Text, x224 y56 w60 h21, mouse sens:
Gui Add, Text, x224 y72 w60 h17, zoom sens:
Gui Add, Text, x288 y56 w30 h17, %sens%
Gui Add, Text, x288 y72 w30 h17, %zoom_sens%
Gui Font
IfWinExist, i)%script_name%.* ahk_class AutoHotkey
{
Gui, Add, Button, x128 y338 w90 h30 gbtCloseScript, Stop Script
}
Else
{
Gui, Add, Button, x128 y338 w90 h30 gbtStartScript, Start Script
}
Gui, Add, Button, x224 y338 w90 h30 gbtSettings, Settings
Gui, Add, Button, x32 y338 w90 h30 gbtCloseGUI, Close GUI
return
GuiClose:
WinGetPos, gui_x, gui_y,,, ahk_id %gui_id%
IniWrite, x%gui_x% y%gui_y%, settings.ini, window position, gui_position
ExitApp
btCloseGUI:
WinGetPos, gui_x, gui_y,,, ahk_id %gui_id%
IniWrite, x%gui_x% y%gui_y%, settings.ini, window position, gui_position
ExitApp
return
btCloseScript:
Ans:=CloseScript(script_name)
Run gui.ahk
return
btSettings:
GoSub, SettingsGUI
return
btStartScript:
Run %script_name%
Run gui.ahk
Run Ahkhider.ahk
return
SettingsGUI:
Gui, 2:New
Gui, Show, %gui_position% w250 h100
Gui, Color, Grey
Gui, Show, w350 h450, No Recoil Script Configuration
Gui, +Hwndgui_id
Gui, Font, cWhite
Gui, Font, s8
Gui Add, Text, x80 y40 w60 h18, Prowler
Gui Add, Text, x80 y62 w60 h18, Hemlock
Gui Add, Text, x80 y84 w60 h18, Scout
Gui Add, Text, x80 y106 w60 h18, R301
Gui Add, Text, x80 y128 w60 h18, R99
Gui Add, Text, x80 y150 w60 h18, Spitfire
Gui Add, Text, x80 y172 w60 h18, Flatline
Gui Add, Text, x80 y194 w60 h18, R45
Gui Add, Text, x80 y216 w60 h18, Alternator
Gui Add, Text, x80 y238 w60 h18, P2020
Gui Add, Text, x80 y260 w102 h18, Peacekeeper Glitch
Gui Add, Text, x80 y282 w102 h18, Havoc
Gui Add, Text, x80 y304 w102 h18, Devotion
Gui Add, Text, x80 y326 w102 h18, Disable Script
Gui Add, Text, x80 y348 w102 h18, Close Script
Gui Add, Text, x80 y370 w102 h18, Pause Script
Gui Add, Button, x224 y360 w90 h30 gbtSave, Save
Gui, Font, cBlack
Gui Add, Edit, x32 y38 w40 h18 vkey_akm, %key_akm%
Gui Add, Edit, x32 y60 w40 h18 vkey_m16a4, %key_m16a4%
Gui Add, Edit, x32 y82 w40 h18 vkey_skspubg, %key_skspubg%
Gui Add, Edit, x32 y104 w40 h18 vkey_uzi, %key_uzi%
Gui Add, Edit, x32 y126 w40 h18 vkey_vector, %key_vector%
Gui Add, Edit, x32 y148 w40 h18 vkey_m416, %key_m416%
Gui Add, Edit, x32 y170 w40 h18 vkey_scar, %key_scar%
Gui Add, Edit, x32 y192 w40 h18 vkey_ump, %key_ump%
Gui Add, Edit, x32 y214 w40 h18 vkey_groza, %key_groza%
Gui Add, Edit, x32 y236 w40 h18 vkey_glock, %key_glock%
Gui Add, Edit, x32 y258 w40 h18 vkey_peacekeeper, %key_peacekeeper%
Gui Add, Edit, x32 y280 w40 h18 vkey_m249, %key_m249%
Gui Add, Edit, x32 y302 w40 h18 vkey_tgun, %key_tgun%
Gui Add, Edit, x32 y324 w40 h18 vrCoff, %key_rCoff%
Gui Add, Edit, x32 y346 w40 h18 vkey_terminate, %key_terminate%
Gui Add, Edit, x32 y368 w40 h18 vkey_pause, %key_pause%
Gui Add, Edit, x288 y40 w31 h18 vsens, %sens%
Gui Add, Edit, x280 y176 w31 h18 vvolume, %volume%
Gui Add, Edit, x280 y200 w31 h18 vrate, %rate%
Gui Add, Edit, x288 y64 w31 h18 vzoom_sens, %zoom_sens%
Gui, Font, cWhite
Gui Add, Text, x224 y40 w57 h18, Sens:
Gui Add, Text, x224 y64 w60 h18, Zoom Sens:
Gui Add, Text, x224 y176 w50 h18, Volume
Gui Add, Text, x224 y200 w50 h18, Speed:
Gui Add, GroupBox, x208 y16 w124 h130 +Left, Mouse Settings
Gui Add, GroupBox, x208 y152 w124 h98 +Left, Voice Settings
Gui Add, GroupBox, x16 y16 w173 h402, Hotkeys Configuration
Gui Add, GroupBox, x208 y256 w123 h89, Script Version
if (script_version="narrator")
{
Gui Add, Radio, x214 y280 w115 h21 gCheck vRadio1 Checked, Narrator (fullscreen)
Gui Add, Radio, x214 y304 w115 h21 gCheck, Tooltip (borderless)
}
else if (script_version="tooltip")
{
Gui Add, Radio, x214 y280 w115 h21 gCheck vRadio1, Narrator (fullscreen)
Gui Add, Radio, x214 y304 w115 h21 gCheck Checked, Tooltip (borderless)
}
else
{
Gui Add, Radio, x214 y280 w115 h21 gCheck vRadio1 Checked, Narrator (fullscreen)
Gui Add, Radio, x214 y304 w115 h21 gCheck, Tooltip (borderless)
}
Gui 2:Show, w350 h450, No Recoil Script Configuration
Gui, -AlwaysOnTop
Gui Add, DropDownList, x287 y87 w32 vList1 gOnSelect1, 0|1|2
Gui Add, Text, x221 y89 w60 h18, Wheel Up:
Gui Add, DropDownList, x287 y112 w32 vList2 gOnSelect2, 0|1|2
Gui Add, Text, x220 y115 w66 h18, Wheel Down:
return
OnSelect1:
Gui, Submit, nohide
if (List1 = "0")
IniWrite, "0", settings.ini, keybinds, mwheel_1
else if (List1 = "1")
IniWrite, "1", settings.ini, keybinds, mwheel_1
else if (List1 = "2")
IniWrite, "2", settings.ini, keybinds, mwheel_1
return
OnSelect2:
Gui, Submit, nohide
if (List2 = "0")
IniWrite, "0", settings.ini, keybinds, mwheel_2
else if (List2 = "1")
IniWrite, "1", settings.ini, keybinds, mwheel_2
else if (List2 = "2")
IniWrite, "2", settings.ini, keybinds, mwheel_2
return
2GuiClose:
run gui.ahk
Check:
Gui, Submit, NoHide
if (Radio1=1)
IniWrite, "narrator", settings.ini, script configs, script_version
else if (Radio1=2)
IniWrite, "tooltip", settings.ini, script configs, script_version
return
btSave:
Gui, submit
IniWrite, "%gui_position%", settings.ini, window position, gui_position
IniWrite, "%script_name%", settings.ini, script configs, script_name
IniWrite, "%key_RCoff%", settings.ini, keybinds, key_disable
IniWrite, "%key_Terminate%", settings.ini, keybinds, key_terminate
IniWrite, "%key_1%", settings.ini, keybinds, key_1
IniWrite, "%key_2%", settings.ini, keybinds, key_2
IniWrite, "%key_4%", settings.ini, keybinds, key_heal
IniWrite, "%key_g%", settings.ini, keybinds, key_grenade
IniWrite, "%key_x%", settings.ini, keybinds, key_holster
IniWrite, "%key_akm%", settings.ini, keybinds, key_prowler
IniWrite, "%key_m16a4%", settings.ini, keybinds, key_hemlok
IniWrite, "%key_skspubg%", settings.ini, keybinds, key_scout
IniWrite, "%key_uzi%", settings.ini, keybinds, key_r301
IniWrite, "%key_vector%", settings.ini, keybinds, key_r99
IniWrite, "%key_m416%", settings.ini, keybinds, key_spitfire
IniWrite, "%key_scar%", settings.ini, keybinds, key_flatline
IniWrite, "%key_ump%", settings.ini, keybinds, key_r45
IniWrite, "%key_groza%", settings.ini, keybinds, key_alternator
IniWrite, "%key_glock%", settings.ini, keybinds, key_p2020
IniWrite, "%key_peacekeeper%", settings.ini, keybinds, key_peacekeeper
IniWrite, "%key_m249%", settings.ini, keybinds, key_havoc
IniWrite, "%key_tgun%", settings.ini, keybinds, key_devotion
IniWrite, "%key_pause%", settings.ini, keybinds, key_pause
IniWrite, "%sens%", settings.ini, mouse settings, sens
IniWrite, "%zoom_sens%", settings.ini, mouse settings, zoom_sens
IniWrite, "%volume%", settings.ini, voice settings, volume
IniWrite, "%rate%", settings.ini, voice settings, rate
Ans:=CloseScript(script_name)
Run gui.ahk
return
IniRead:
IfNotExist, settings.ini
{
MsgBox, Couldn't find settings.ini. I'll create one for you.
IniWrite, "F1", settings.ini, keybinds, key_prowler
IniWrite, "F2", settings.ini, keybinds, key_hemlok
IniWrite, "F3", settings.ini, keybinds, key_scout
IniWrite, "F4", settings.ini, keybinds, key_r301
IniWrite, "F5", settings.ini, keybinds, key_r99
IniWrite, "F6", settings.ini, keybinds, key_spitfire
IniWrite, "F7", settings.ini, keybinds, key_flatline
IniWrite, "F8", settings.ini, keybinds, key_r45
IniWrite, "F9", settings.ini, keybinds, key_alternator
IniWrite, "F10", settings.ini, keybinds, key_p2020
IniWrite, "F11", settings.ini, keybinds, key_peacekeeper
IniWrite, "F12", settings.ini, keybinds, key_havoc
IniWrite, "", settings.ini, keybinds, key_devotion
IniWrite, "9", settings.ini, keybinds, key_disable
IniWrite, "Del", settings.ini, keybinds, key_terminate
IniWrite, "1", settings.ini, keybinds, key_1
IniWrite, "2", settings.ini, keybinds, key_2
IniWrite, "0", settings.ini, keybinds, mwheel_1
IniWrite, "0", settings.ini, keybinds, mwheel_2
IniWrite, "4", settings.ini, keybinds, key_heal
IniWrite, "G", settings.ini, keybinds, key_grenade
IniWrite, "3", settings.ini, keybinds, key_holster
IniWrite, "INS"`n, settings.ini, keybinds, key_pause
IniWrite, "5.0", settings.ini, mouse settings, sens
IniWrite, "1.0"`n, settings.ini, mouse settings, zoom_sens
IniWrite, "80", settings.ini, voice settings, volume
IniWrite, "7"`n, settings.ini, voice settings, rate
IniWrite, "narrator", settings.ini, script configs, script_version
IniWrite, "no-recoil.ahk"`n, settings.ini, script configs, script_name
IniWrite, "", settings.ini, window position, gui_position
IniRead, script_name, settings.ini, script configs, script_name
Run, gui.ahk
}
Else
{
IniRead, key_RCoff, settings.ini, keybinds, key_disable
IniRead, key_Terminate, settings.ini, keybinds, key_terminate
IniRead, key_1, settings.ini, keybinds, key_1
IniRead, key_2, settings.ini, keybinds, key_2
IniRead, mwheel_1, settings.ini, keybinds, mwheel_1
IniRead, mwheel_2, settings.ini, keybinds, mwheel_2
IniRead, key_4, settings.ini, keybinds, key_heal
IniRead, key_g, settings.ini, keybinds, key_grenade
IniRead, key_x, settings.ini, keybinds, key_holster
IniRead, key_akm, settings.ini, keybinds, key_prowler
IniRead, key_m16a4, settings.ini, keybinds, key_hemlok
IniRead, key_skspubg, settings.ini, keybinds, key_scout
IniRead, key_uzi, settings.ini, keybinds, key_r301
IniRead, key_vector, settings.ini, keybinds, key_r99
IniRead, key_m416, settings.ini, keybinds, key_spitfire
IniRead, key_scar, settings.ini, keybinds, key_flatline
IniRead, key_ump, settings.ini, keybinds, key_r45
IniRead, key_groza, settings.ini, keybinds, key_alternator
IniRead, key_glock, settings.ini, keybinds, key_p2020
IniRead, key_peacekeeper, settings.ini, keybinds, key_peacekeeper
IniRead, key_m249, settings.ini, keybinds, key_havoc
IniRead, key_tgun, settings.ini, keybinds, key_devotion
IniRead, key_pause, settings.ini, keybinds, key_pause
IniRead, sens, settings.ini, mouse settings, sens
IniRead, zoom_sens, settings.ini, mouse settings, zoom_sens
IniRead, volume, settings.ini, voice settings, volume
IniRead, rate, settings.ini, voice settings, rate
IniRead, script_version, settings.ini, script configs, script_version
IniRead, script_name, settings.ini, script configs, script_name
IniRead, gui_position, settings.ini, window position, gui_position
}
return
CloseScript(Name)
{
DetectHiddenWindows On
SetTitleMatchMode RegEx
IfWinExist, i)%Name%.* ahk_class AutoHotkey
{
WinClose
WinWaitClose, i)%Name%.* ahk_class AutoHotkey, , 2
If ErrorLevel
return "Unable to close " . Name
else
return "Closed " . Name
}
else
return Name . " not found"
}