-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYawspeed.ahk
92 lines (78 loc) · 1.99 KB
/
Yawspeed.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
if DirExist("C:\Temp\") {
} else {
DirCreate("C:\Temp\")
}
if FileExist("C:\Temp\config.ini") {
} else {
FileAppend "
(
[Sensitivity]
value=100
)", A_LoopFileDir "\Temp\config.ini"
}
#SingleInstance force
Pause
A_MaxHotkeysPerInterval := 99000000
A_HotkeyInterval := 99000000
KeyHistory(0)
ListLines(false)
ProcessSetPriority("A")
SetKeyDelay(-1, -1)
SetDefaultMouseSpeed(0)
SetWinDelay(-1)
SetControlDelay(-1)
SendMode("Input")
SystemTime()
{
freq := 0, tick := 0
If (!freq)
DllCall("QueryPerformanceFrequency", "Int64*", &freq)
DllCall("QueryPerformanceCounter", "Int64*", &tick)
Return tick / freq * 1000
}
HyperSleep(value)
{
s_begin_time := SystemTime()
freq := 0, t_current := 0
DllCall("QueryPerformanceFrequency", "Int64*", &freq)
s_end_time := (s_begin_time + value) * freq / 1000
While (t_current < s_end_time)
{
If (s_end_time - t_current) > 20000
{
DllCall("Winmm.dll\timeBeginPeriod", "UInt", 1)
DllCall("Sleep", "UInt", 1)
DllCall("Winmm.dll\timeEndPeriod", "UInt", 1)
DllCall("QueryPerformanceCounter", "Int64*", &t_current)
}
Else
DllCall("QueryPerformanceCounter", "Int64*", &t_current)
}
}
F11::
{
if WinExist("config")
{
WinClose
} else {
Run("C:\Temp\config.ini")
}
}
~*xbutton2:: ;turn right
{
while GetKeyState("xbutton2") ;turn right
{
yRight:= IniRead("C:\Temp\config.ini", "Sensitivity", "value")
DllCall("mouse_event", "int64", 1, "int64", yRight, "int", -000.1, "uint", 0, "int", 0)
HyperSleep(1)
}
}
~*xbutton1:: ;turn left
{
while GetKeyState("xbutton1") ;turn left
{
yLeft:= IniRead("C:\Temp\config.ini", "Sensitivity", "value")
DllCall("mouse_event", "int64", 1, "int64", -yLeft, "int", -000.1, "uint", 0, "int", 0)
HyperSleep(1)
}
}