@@ -37,7 +37,7 @@ menu.Style.Outline = true -- Outline around the menu
37
37
end, ItemFlags.FullWidth))]]
38
38
local Swingpred = menu :AddComponent (MenuLib .Checkbox (" Enable" , true , ItemFlags .FullWidth ))
39
39
local Maimbot = menu :AddComponent (MenuLib .Checkbox (" Aimbot(Rage)" , true , ItemFlags .FullWidth ))
40
- local mtime = menu :AddComponent (MenuLib .Slider (" attack delay(ticks)" ,6 , 30 , 17 ))
40
+ local mtime = menu :AddComponent (MenuLib .Slider (" attack delay(ticks)" ,3 , 20 , 14 ))
41
41
local mAutoRefill = menu :AddComponent (MenuLib .Checkbox (" Crit Refill" , true ))
42
42
local mAutoGarden = menu :AddComponent (MenuLib .Checkbox (" Troldier assist" , false ))
43
43
local mmVisuals = menu :AddComponent (MenuLib .Checkbox (" Enable Visuals" , false ))
@@ -74,6 +74,7 @@ local vdistance
74
74
local fDistance
75
75
local vPlayerFuture
76
76
local pLocalFuture
77
+ local ping = 0
77
78
78
79
function GetClosestEnemy (pLocal , pLocalOrigin )
79
80
local players = entities .FindByClass (" CTFPlayer" ) -- Create a table of all players in the game
@@ -153,7 +154,7 @@ function TargetPositionPrediction(targetLastPos, tickRate, time, targetEntity)
153
154
end
154
155
155
156
-- if time is more then 5 then expect ticks and convert ticks into decimal of time
156
- if time > 5 then
157
+ if time > 2 then
157
158
time = time / tickRate
158
159
end
159
160
@@ -220,8 +221,8 @@ local function OnCreateMove(pCmd)
220
221
-- [--if we are not existign then stop code--]
221
222
pLocal = entities .GetLocalPlayer () -- Immediately set "pLocal" to the local player (entities.GetLocalPlayer)
222
223
if not pLocal then return end -- Immediately check if the local player exists. If it doesn't, return.
223
-
224
- -- [--Check local player class if spy or none then stop code--]
224
+ ping = entities . GetPlayerResources (): GetPropDataTableInt ( " m_iPing " )[ pLocal : GetIndex ()]
225
+ -- [--Check local player class if spy or none then stop code--]
225
226
226
227
pLocalClass = pLocal :GetPropInt (" m_iClass" ) -- getlocalclass
227
228
if pLocalClass == nil then goto continue end -- when local player did not chose class then skip code
@@ -282,31 +283,16 @@ local function OnCreateMove(pCmd)
282
283
if closestPlayer == nil then
283
284
if mAutoRefill :GetValue () and pWeapon :GetCritTokenBucket () <= 27 then
284
285
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK )
285
- end goto continue
286
+ end goto continue
286
287
end
287
288
288
289
vPlayerOrigin = closestPlayer :GetAbsOrigin ()
289
290
290
- -- [--------------AutoAim-------------------]
291
- if Maimbot :GetValue () then
292
- -- get hitbox of ennmy pelwis(jittery but works)
293
- local hitboxes = closestPlayer :GetHitboxes ()
294
- local hitbox = hitboxes [4 ]
295
- local angles = (hitbox [1 ] + hitbox [2 ]) * 0.5
296
- -- Aim at the target
297
- angles = Math .PositionAngles (pLocalOrigin , angles )
298
- pCmd :SetViewAngles (angles :Unpack ())
299
- --[[ if not options.Silent then
300
- engine.SetViewAngles(angles)
301
- --end]]
302
- end
303
-
304
-
305
291
-- [--------------Prediction-------------------] -- predict both players position after swing
306
292
307
293
vPlayerFuture = TargetPositionPrediction (vPlayerOrigin , tickRate , time , closestPlayer )
308
294
pLocalFuture = TargetPositionPrediction (pLocalOrigin , tickRate , time , pLocal )
309
-
295
+
310
296
-- [--------------Distance check-------------------]
311
297
-- get current distance between local player and closest player
312
298
vdistance = (vPlayerOrigin - pLocalOrigin ):Length ()
319
305
local stop = false
320
306
swingrange = pWeapon :GetSwingRange ()
321
307
322
- -- bypass problem with prior attacking with shield not beeign able to reach target..
308
+ -- [ bypass problem with prior attacking with shield not beeign able to reach target] ..
323
309
if (pLocal :InCond (17 )) and pLocalClass == 4 or pLocalClass == 8 then -- If we are charging (17 is TF_COND_SHIELD_CHARGE)
324
310
stop = true
325
311
local dynamicstop = swingrange
@@ -331,10 +317,32 @@ end
331
317
end
332
318
end
333
319
334
- -- wall check
335
- local trace = engine .TraceLine (pLocalFuture , vPlayerFuture , MASK_SHOT_HULL )
336
- if (trace .entity :GetClass () == " CTFPlayer" ) and (trace .entity :GetTeamNumber () ~= pLocal :GetTeamNumber ()) then
320
+ -- [--------------AimBot-------------------]
321
+ if Maimbot :GetValue () and Helpers .VisPos (closestPlayer ,vPlayerFuture + Vector3 (0 , 0 , 150 ), pLocalFuture ) then
322
+ -- get hitbox of ennmy pelwis(jittery but works)
323
+ local hitboxes = closestPlayer :GetHitboxes ()
324
+ local hitbox = hitboxes [4 ]
325
+ local aimpos = (hitbox [1 ] + hitbox [2 ]) * 0.5
326
+
327
+ if pLocal :InCond (17 ) then -- if can hit then aimbot
328
+ -- change angles at target
329
+ aimpos = Math .PositionAngles (pLocalOrigin , vPlayerFuture + Vector3 (0 , 0 , 60 ))
330
+ pCmd :SetViewAngles (aimpos :Unpack ()) -- engine.SetViewAngles(aimpos)
331
+
332
+ else -- if predicted position is visible then aim at it
333
+ -- change angles at target
334
+ aimpos = Math .PositionAngles (pLocalOrigin , aimpos )
335
+ pCmd :SetViewAngles (aimpos :Unpack ())
336
+ end
337
+ end
337
338
339
+ -- [----------------wall check Future-------------]
340
+
341
+ -- trace = engine.TraceLine(pLocalFuture, vPlayerFuture + Vector3(0, 0, 150), MASK_SHOT_HULL)
342
+ -- if (trace.entity:GetClass() == "CTFPlayer") and (trace.entity:GetTeamNumber() ~= pLocal:GetTeamNumber()) then
343
+ -- Visiblity Check
344
+ if Helpers .VisPos (closestPlayer ,vPlayerFuture + Vector3 (0 , 0 , 150 ), pLocalFuture ) then
345
+ --[[ check if can hit after swing]]
338
346
can_attack = isWithinHitbox (GetTriggerboxMin (swingrange , vPlayerFuture ), GetTriggerboxMax (swingrange , vPlayerFuture ), pLocalFuture , vPlayerFuture )
339
347
340
348
if fDistance <= (swingrange + 60 ) then
344
352
elseif can_attack == false then
345
353
can_attack = isWithinHitbox (GetTriggerboxMin (swingrange , vPlayerOrigin ), GetTriggerboxMax (swingrange , vPlayerOrigin ), pLocalOrigin , vPlayerOrigin )
346
354
end
347
- end
355
+ end
348
356
349
357
350
358
-- Attack when futere position is inside attack range triggerbox
0 commit comments