-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGear System.CEA
116 lines (97 loc) · 2.06 KB
/
Gear System.CEA
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
{$lua}
[ENABLE]
local mul=1+3e-3
local rangeMultiplier=1.5
local Up=1
local Down=0
local div=0.85
local motion=1e-3
local speedXString='X SPEED road'
local speedYString='Y SPEED road'
--Gear is increased by W and decreased by S
local TempUp=Up
local TempDown=Down
hk1=createHotkey(function()
t=getAddressList()
x=t.getMemoryRecordByDescription(speedXString)
y=t.getMemoryRecordByDescription(speedYString)
r=((x.Value^2)+(y.Value^2))^0.5
if r>=motion then
if r>TempUp then
ratio=TempUp/r
x.Value=x.Value*ratio
y.Value=y.Value*ratio
elseif r<TempDown then
ratio=TempDown/r
x.Value=x.Value*ratio
y.Value=y.Value*ratio
else
x.Value=x.Value*mul
y.Value=y.Value*mul
end
end
end,0x26)
hk2=createHotkey(function()
x=getAddressList().getMemoryRecordByDescription(speedXString)
y=getAddressList().getMemoryRecordByDescription(speedYString)
r=((x.Value^2)+(y.Value^2))^0.5
if r>=motion then
if r>TempDown then
x.Value=x.Value*div
y.Value=y.Value*div
else
ratio=TempDown/r
x.Value=x.Value*ratio
y.Value=y.Value*ratio
end
end
end,0x28)
hk3=createHotkey(function()
TempDown=TempUp
TempUp=TempUp*rangeMultiplier
t=getAddressList()
x=t.getMemoryRecordByDescription(speedXString)
y=t.getMemoryRecordByDescription(speedYString)
r=((x.Value^2)+(y.Value^2))^0.5
if r>=motion then
ratio=TempDown/r
x.Value=x.Value*ratio
y.Value=y.Value*ratio
end
speak('Gear Up')
end,0x57)
hk6=createHotkey(function()
TempUp=TempDown
TempDown=TempDown/rangeMultiplier
t=getAddressList()
x=t.getMemoryRecordByDescription(speedXString)
y=t.getMemoryRecordByDescription(speedYString)
r=((x.Value^2)+(y.Value^2))^0.5
if r>=motion then
mid=(TempUp+TempDown)/2
ratio=mid/r
x.Value=x.Value*ratio
y.Value=y.Value*ratio
end
speak('Gear Down')
end,0x53)
hk7=createHotkey(function()
TempUp=Up
TempDown=Down
t=getAddressList()
x=t.getMemoryRecordByDescription(speedXString)
y=t.getMemoryRecordByDescription(speedYString)
r=((x.Value^2)+(y.Value^2))^0.5
if r>=motion then
ratio=TempUp/r
x.Value=x.Value*ratio
y.Value=y.Value*ratio
end
speak('Reset')
end,0x52)
[DISABLE]
hk1.destroy()
hk2.destroy()
hk3.destroy()
hk6.destroy()
hk7.destroy()