@@ -28,18 +28,11 @@ local mAutoRefill = menu:AddComponent(MenuLib.Checkbox("Crit Refill", true))
28
28
local debug = menu :AddComponent (MenuLib .Checkbox (" Visuals" , false ))
29
29
local mAutoGarden = menu :AddComponent (MenuLib .Checkbox (" Troldier assist" , false ))
30
30
local mKillaura = menu :AddComponent (MenuLib .Checkbox (" Killaura (soon)" , false ))
31
- local mtime = menu :AddComponent (MenuLib .Slider (" attack distance" , 150 ,300 , 250 ))
32
-
33
- local solution = {
34
- " default" ,
35
- " strafe pred"
36
- }
37
-
38
- local msolution = menu :AddComponent (MenuLib .Combo (" Prediction Solution" , solution ))
31
+ local mtime = menu :AddComponent (MenuLib .Slider (" attack distance" , 150 ,330 , 300 ))
39
32
-- solution:GetSelectedIndex() -- Selected item index (number)
40
33
41
34
-- amples = menu:AddComponent(MenuLib.Slider("movement ahead", 1 ,25 , 200 ))
42
- local msamples = 66
35
+ local msamples = 66
43
36
local pastPredictions = {}
44
37
local hitbox_min = Vector3 (14 , 14 , 0 )
45
38
local hitbox_max = Vector3 (- 14 , - 14 , 85 )
@@ -91,28 +84,11 @@ function GetClosestEnemy(pLocal, pLocalOrigin)
91
84
end
92
85
end
93
86
94
- local lastVectors = {}
95
-
96
- function interpolateVectors (current , last , t )
97
- local totalIterations = 8
98
- local iterations = t % totalIterations
99
- local percent = iterations / totalIterations
100
-
101
- -- Check if a last vector exists for this current vector, otherwise set it to the current vector
102
- if lastVectors [current ] == nil then
103
- lastVectors [current ] = current
104
- end
105
-
106
- local interpolated = lastVectors [current ] + (last - lastVectors [current ]) * percent
107
87
108
- lastVectors [current ] = interpolated
109
-
110
- return interpolated
111
- end
112
88
113
89
114
90
115
- function TargetPositionPrediction (targetLastPos , targetOriginLast , tickRate , time , tick )
91
+ --[[ function TargetPositionPrediction(targetLastPos, targetOriginLast, tickRate, time, tick)
116
92
-- If the origin of the target from the previous tick is nil, initialize it to a zero vector.
117
93
if targetOriginLast == nil then
118
94
targetOriginLast = Vector3(0, 0, 0)
@@ -138,7 +114,7 @@ function TargetPositionPrediction(targetLastPos, targetOriginLast, tickRate, tim
138
114
local targetVelocity = targetLastPos - targetOriginLast
139
115
table.insert(targetVelocitySamples[targetKey], 1, targetVelocity)
140
116
141
- local samples = msamples : GetValue ()
117
+ local samples = msamples
142
118
-- Remove the oldest sample if there are more than maxSamples.
143
119
if #targetVelocitySamples[targetKey] > samples then
144
120
table.remove(targetVelocitySamples[targetKey], samples + 1)
@@ -177,7 +153,7 @@ function TargetPositionPrediction(targetLastPos, targetOriginLast, tickRate, tim
177
153
targetFutureLast = targetFuture
178
154
-- Return the predicted future position.
179
155
return targetFuture
180
- end
156
+ end]]
181
157
182
158
183
159
local vhitbox_Height = 85
@@ -229,19 +205,17 @@ end
229
205
230
206
--[[ Code needed to run 66 times a second ]] --
231
207
local function OnCreateMove (pCmd )
232
- if not Swingpred :GetValue () then goto continue end -- enable or distable script
233
-
234
- -- Use pLocal, pWeapon, pWeaponDefIndex, etc. as needed
235
- if not pLocal then goto continue end -- Immediately check if the local player exists. If it doesn't, return.
236
- local pLocalClass = pLocal :GetPropInt (" m_iClass" ) -- getlocalclass
237
- if pLocalClass == nil then goto continue end
238
- if pLocalClass == 8 then goto continue end
239
- local pWeapon = pLocal :GetPropEntity (" m_hActiveWeapon" )
240
- local swingrange = pWeapon :GetSwingRange () -- + 11.17
241
- local flags = pLocal :GetPropInt ( " m_fFlags" )
242
- local players = entities .FindByClass (" CTFPlayer" ) -- Create a table of all players in the game
243
- local time = mtime :GetValue () * 0.001
244
-
208
+ if not Swingpred :GetValue () then goto continue end -- enable or distable script
209
+ if not pLocal then goto continue end -- Immediately check if the local player exists. If it doesn't, return.
210
+
211
+ local pLocalClass = pLocal :GetPropInt (" m_iClass" ) -- getlocalclass
212
+ if pLocalClass == nil then goto continue end -- when local player did not chose class then skip code
213
+ if pLocalClass == 8 then goto continue end -- when local player is spy then skip code
214
+ local pWeapon = pLocal :GetPropEntity (" m_hActiveWeapon" )
215
+ local swingrange = pWeapon :GetSwingRange () -- + 11.17
216
+ local flags = pLocal :GetPropInt ( " m_fFlags" )
217
+ local players = entities .FindByClass (" CTFPlayer" ) -- Create a table of all players in the game
218
+ local time = mtime :GetValue () * 0.001
245
219
246
220
if mAutoGarden :GetValue () == true then
247
221
local bhopping = false
@@ -283,19 +257,8 @@ if closestPlayer == nil then goto continue end
283
257
local Killaura = mKillaura :GetValue ()
284
258
285
259
--[[ position prediction]] --
286
-
287
-
288
- if msolution :IsSelected (" default" ) then
289
260
vPlayerFuture = (vPlayerOrigin + closestPlayer :EstimateAbsVelocity () * time )-- TargetPositionPrediction(vPlayerOrigin, vPlayerOriginLast, tickRate, time, tick)
290
261
pLocalFuture = (pLocalOrigin + pLocal :EstimateAbsVelocity () * time ) -- TargetPositionPrediction(pLocalOrigin, pLocalOriginLast, tickRate, time, tick)
291
- else
292
- if tick % 8 == 0 or tick == nil then
293
- tick = 0
294
- end
295
- tick = tick + 1
296
- vPlayerFuture = TargetPositionPrediction (vPlayerOrigin , vPlayerOriginLast , tickRate , time , tick )
297
- pLocalFuture = TargetPositionPrediction (pLocalOrigin , pLocalOriginLast , tickRate , time , tick )
298
- end
299
262
300
263
301
264
--[[ -----------------------------Swing Prediction------------------------------------------------------------------------]]
0 commit comments