-
Notifications
You must be signed in to change notification settings - Fork 0
/
BedrockSprint.ahk
127 lines (110 loc) · 2.83 KB
/
BedrockSprint.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
; Bedrock Sprint
; By Shock59
#NoEnv
#SingleInstance, Force
SendMode, Input
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir%
Loop, Read, .\sprintConfig.txt
{
switch A_Index
{
Case 1:
ToggleSprintEnabled = %A_LoopReadLine%
Case 2:
MinecraftSprintKey = %A_LoopReadLine%
Case 3:
ToggleSprintKey = %A_LoopReadLine%
Case 4:
ToggleCrouchEnabled = %A_LoopReadLine%
Case 5:
MinecraftCrouchKey = %A_LoopReadLine%
Case 6:
ToggleCrouchKey = %A_LoopReadLine%
Case 7:
ToggleSuspendKey = %A_LoopReadLine%
Case 8:
FontFamily = %A_LoopReadLine%
Case 9:
WindowX = %A_LoopReadLine%
Case 10:
WindowY = %A_LoopReadLine%
}
}
global Sprinting = "false"
global Crouching = "false"
global Suspended = "false"
if (ToggleSprintEnabled = "true")
{
HotKey, %ToggleSprintKey%, ToggleSprint
}
if (ToggleCrouchEnabled = "true")
{
HotKey, %ToggleCrouchKey%, ToggleCrouch
}
HotKey, %ToggleSuspendKey%, ToggleSuspend
if (ToggleSprintEnabled = "true" And ToggleCrouchEnabled = "true") {
GuiHeight = 40
} else {
GuiHeight = 20
}
Gui, Font, s20, %FontFamily%
Gui, Margin, 0, 0
Gui, Add, Text, cWhite vSprintIndicator w200 x0 y0,
Gui, Add, Text, cWhite vCrouchIndicator w200 x0 y40,
Gui, Color, 0x000000
Gui, Show, w200 h%GuiHeight% x%WindowX% y%WindowY%
Gui, +alwaysontop -caption
Return
ToggleSprint:
if (Sprinting = "false") {
global Sprinting = "true"
GuiControl,, SprintIndicator, Sprinting
} else {
global Sprinting = "false"
GuiControl,, SprintIndicator,
}
Return
ToggleCrouch:
if (Crouching = "false") {
global Crouching = "true"
GuiControl,, CrouchIndicator, Crouching
} else {
global Crouching = "false"
GuiControl,, CrouchIndicator,
}
Return
ToggleSuspend:
Suspend, Toggle
if (Suspended = "false") {
global Suspended = "true"
GuiControl,, SprintIndicator, Suspended
} else {
global Suspended = "false"
if (Sprinting = "true") {
GuiControl,, SprintIndicator, Sprinting
} else {
GuiControl,, SprintIndicator,
}
}
Return
*w::
if (Sprinting = "true") {
Send, {%MinecraftSprintKey% down}
}
if (Crouching = "true") {
Send, {%MinecraftCrouchKey% down}
}
Send, {w down}
KeyWait, w
if (Sprinting = "true") {
Send, {%MinecraftSprintKey% up}
}
if (Crouching = "true") {
Send, {%MinecraftCrouchKey% up}
}
Send, {w up}
Return
GuiClose:
exitapp
Return