@@ -43,7 +43,7 @@ local Mchargebot = menu:AddComponent(MenuLib.Checkbox("Charge Controll", true
43
43
-- local mAutoMelee = menu:AddComponent(MenuLib.Checkbox("Auto Melee", true, ItemFlags.FullWidth))
44
44
local mFov = menu :AddComponent (MenuLib .Slider (" Aimbot FOV" ,10 ,360 ,360 ))
45
45
local mAutoRefill = menu :AddComponent (MenuLib .Checkbox (" Crit Refill" , true ))
46
- local Achargebot = menu :AddComponent (MenuLib .Checkbox (" Charge Reach" , true , ItemFlags .FullWidth ))
46
+ local AchargeRange = menu :AddComponent (MenuLib .Checkbox (" Charge Reach" , true , ItemFlags .FullWidth ))
47
47
local mAutoGarden = menu :AddComponent (MenuLib .Checkbox (" Troldier assist" , false ))
48
48
local mmVisuals = menu :AddComponent (MenuLib .Checkbox (" Enable Visuals" , false ))
49
49
local mKeyOverrite = menu :AddComponent (MenuLib .Keybind (" Manual overide" , key ))
@@ -67,9 +67,13 @@ local pLocal = entities.GetLocalPlayer()
67
67
local vdistance = 1
68
68
local ping = 0
69
69
local swingrange = 70
70
- local time = 16
71
70
local tickRate = 66
72
71
local tick_count = 0
72
+ local in_attack
73
+
74
+ local time = 17
75
+ local last_time = time
76
+ local swing_delay = time
73
77
74
78
local pLocalClass = nil
75
79
local pLocalFuture = nil
@@ -187,6 +191,7 @@ local function GetBestTarget(me)
187
191
188
192
local factor = distanceFactor * healthFactor * fovFactor
189
193
targetCount = targetCount + 1
194
+
190
195
targetList [targetCount ] = { player = player , factor = factor }
191
196
192
197
:: continue::
216
221
217
222
-- Predicts player position after set amount of ticks
218
223
--- @param targetLastPos Vector3
219
- --- @param time integer
224
+ --- @param Ltime integer
220
225
--- @param targetEntity number
221
226
--- @param strafeAngle number
222
227
--- @return Vector3 ?
@@ -310,7 +315,7 @@ local Hitbox = {
310
315
Chest = 7
311
316
}
312
317
313
- function UpdateViewAngles (pCmd )
318
+ local function ChargeControll (pCmd )
314
319
-- Get the current view angles
315
320
local sensetivity = client .GetConVar (" sensitivity" ) + 2 -- mSensetivity:GetValue() / 10 --0.4
316
321
local currentAngles = engine .GetViewAngles ()
@@ -335,7 +340,8 @@ local function OnCreateMove(pCmd)
335
340
end
336
341
local flags = pLocal :GetPropInt (" m_fFlags" )
337
342
--[[ ping = entities.GetPlayerResources():GetPropDataTableInt("m_iPing")[pLocal:GetIndex()]]
338
- chargeLeft = pLocal :GetPropInt (" m_flChargeMeter" )
343
+ chargeLeft = pLocal :GetPropFloat (" m_flChargeMeter" )
344
+ chargeLeft = math.floor (chargeLeft )
339
345
340
346
-- [--Check local player class if spy or none then stop code--]
341
347
@@ -357,6 +363,7 @@ local function OnCreateMove(pCmd)
357
363
-- Convert the delay to ticks
358
364
Latency = math.floor (Latency * tickRate + 1 )
359
365
366
+
360
367
-- Add the ticks to the current time
361
368
-- time = time + Latency - Tolerances
362
369
@@ -369,12 +376,11 @@ local function OnCreateMove(pCmd)
369
376
if not pWeapon then
370
377
return
371
378
end
372
-
379
+ local pWeaponData = pWeapon : GetWeaponData ()
373
380
local pWeaponDefIndex = pWeapon :GetPropInt (" m_iItemDefinitionIndex" ) -- Set "pWeaponDefIndex" to the "pWeapon"'s item definition index
374
381
local pWeaponDef = itemschema .GetItemDefinitionByID (pWeaponDefIndex ) -- Set "pWeaponDef" to the local "pWeapon"'s item definition
375
382
local pWeaponName = pWeaponDef :GetName ()
376
383
swingrange = pWeapon :GetSwingRange ()
377
-
378
384
local players = entities .FindByClass (" CTFPlayer" ) -- Create a table of all players in the game
379
385
if # players == 0 then
380
386
return -- Immediately check if there are any players in the game. If there aren't, return.
@@ -452,7 +458,7 @@ end]]--
452
458
-- Manual charge control
453
459
454
460
if Mchargebot :GetValue () and pLocal :InCond (17 ) then
455
- UpdateViewAngles (pCmd )
461
+ ChargeControll (pCmd )
456
462
end
457
463
458
464
-- [-----Get best target------------------]
@@ -554,7 +560,9 @@ collision, collisionPoint = checkCollision(vPlayerFuture, pLocalFuture, swingran
554
560
555
561
end
556
562
557
- if pLocalClass == 4 and Achargebot :GetValue () and chargeLeft >= 100 then -- Check for collision during charge
563
+ -- Check for charge range
564
+ print (chargeLeft )
565
+ if pLocalClass == 4 and AchargeRange :GetValue () and chargeLeft == 100 then -- Check for collision during charge
558
566
collision = checkCollision (vPlayerFuture , pLocalOrigin , (swingrange * 1.5 ))
559
567
if collision then
560
568
can_attack = true
@@ -598,38 +606,46 @@ collision, collisionPoint = checkCollision(vPlayerFuture, pLocalFuture, swingran
598
606
599
607
elseif not inAttackAim and Mchargebot :GetValue () and pLocal :InCond (17 ) then -- manual charge controll
600
608
-- Calculate the source and destination vectors
601
- UpdateViewAngles (pCmd )
609
+ ChargeControll (pCmd )
602
610
end
603
611
604
612
-- [shield bashing strat]
605
613
606
614
if pLocalClass == 4 and (pLocal :InCond (17 )) then -- If we are charging (17 is TF_COND_SHIELD_CHARGE)
607
- local collision1 = checkCollision (vPlayerFuture , pLocalOrigin , 18 )
615
+ local Bashed = checkCollision (vPlayerFuture , pLocalOrigin , 18 )
608
616
609
- if not collision1 then -- if demoknight bashed on enemy
617
+ if not Bashed then -- if demoknight bashed on enemy
610
618
can_attack = false
611
619
goto continue
612
620
end
613
621
end
614
622
615
623
-- Check if attack simulation was succesfull
616
- if can_attack then
617
-
624
+ if can_attack == true then
625
+ -- remove tick
626
+ time = time - 1
627
+
618
628
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK )-- attack
619
629
620
- elseif mAutoRefill :GetValue () then
621
- if pWeapon :GetCritTokenBucket () <= 27 and fDistance > 400 then
630
+ elseif mAutoRefill :GetValue () == true then
631
+ if pWeapon :GetCritTokenBucket () <= 27 and fDistance > 350 then
622
632
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK )-- refill
623
633
end
634
+ else
635
+ time = swing_delay
624
636
end
625
637
626
638
if can_charge then
627
639
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK2 )-- charge
628
640
end
629
-
641
+
642
+ if time % swing_delay == 0 or time == last_time then
643
+ time = swing_delay
644
+ end
630
645
631
646
632
647
-- Update last variables
648
+ last_time = time
633
649
Safe_Strafe = false -- reset safe strafe
634
650
:: continue::
635
651
end
@@ -815,8 +831,8 @@ if not mmVisuals:GetValue() or not pWeapon:IsMeleeWeapon() then return end
815
831
end
816
832
end
817
833
818
- -- Draw a second circle if Achargebot is enabled
819
- if pLocalClass == 4 and Achargebot :GetValue () and chargeLeft >= 100 then
834
+ -- Draw a second circle if AchargeRange is enabled
835
+ if pLocalClass == 4 and AchargeRange :GetValue () and chargeLeft >= 100 then
820
836
-- Define the color for the second circle
821
837
local color = {r = 0 , g = 0 , b = 255 , a = 255 } -- blue
822
838
0 commit comments