Skip to content

Commit 30e8ecf

Browse files
v2.8.0
1 parent 8aeccf5 commit 30e8ecf

File tree

1 file changed

+130
-133
lines changed

1 file changed

+130
-133
lines changed

Hvh_Tools.lua

Lines changed: 130 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ local atenemy = menu:AddComponent(MenuLib.Checkbox("At enemy", true))
5555
local mHeadSize = menu:AddComponent(MenuLib.Slider("Angle Distance", 1, 60, 44)) --45
5656
local Jitter_Range_Real = menu:AddComponent(MenuLib.Slider("Jitter Range", 30, 180, 55)) --65
5757

58+
client.SetConVar("cl_vWeapon_sway_interp", 0) -- Set cl_vWeapon_sway_interp to 0
59+
client.SetConVar("cl_jiggle_bone_framerate_cutoff", 0) -- Set cl_jiggle_bone_framerate_cutoff to 0
60+
client.SetConVar("cl_bobcycle", 10000) -- Set cl_bobcycle to 10000
61+
client.SetConVar("sv_cheats", 1) -- debug fast setup
62+
client.SetConVar("mp_disable_respawn_times", 1)
63+
client.SetConVar("mp_respawnwavetime", -1)
64+
client.SetConVar("mp_teams_unbalance_limit", 1000)
5865

5966
--local mHeadShield = menu:AddComponent(MenuLib.Checkbox("head Shield", true))
6067

@@ -70,6 +77,12 @@ local jitter_Real = 0
7077
local jitter_Fake = 0
7178
local number = 0
7279
local Got_Hit = false
80+
local pitchType
81+
local BEST = 1
82+
local BEST_UP = 2
83+
local BEST_DOWN = 3
84+
local UNSAFE = 4
85+
local pitchtype1 = gui.GetValue("Anti Aim - Pitch")
7386
local players = entities.FindByClass("CTFPlayer")
7487

7588
local TargetAngle
@@ -369,7 +382,6 @@ end]]
369382

370383

371384

372-
373385
--[[every 2 seconds it will update
374386
tick_count = tick_count + 1
375387
if tick_count % 132 == 0 then
@@ -381,47 +393,67 @@ local function updateYaw(Jitter_Real, Jitter_Fake)
381393
local targetPos = currentTarget
382394
if targetPos == nil then goto continue end
383395

384-
local playerPos = entities.GetLocalPlayer():GetAbsOrigin()
385-
local forwardVec = engine.GetViewAngles():Forward()
386-
387-
targetAngle = math.deg(math.atan(targetPos.y - playerPos.y, targetPos.x - playerPos.x))
388-
local viewAngle = math.deg(math.atan(forwardVec.y, forwardVec.x))
389-
TargetAngle = math.floor(targetAngle - viewAngle)
390-
391-
local yaw
392-
if not atenemy:GetValue() then
393-
yaw = Jitter_Fake
394-
else
395-
yaw = TargetAngle + Jitter_Fake
396-
end
397-
-- Clamp the yaw angle if it's greater than 180 or less than -180
398-
if yaw > 180 then
399-
yaw = yaw - 360
400-
elseif yaw < -180 then
401-
yaw = yaw + 360
402-
end
403-
404-
Jitter_Fake1 = yaw - TargetAngle
405-
406-
yaw = math.floor(yaw)
407-
408-
gui.SetValue("Anti Aim - Custom Yaw (Fake)", yaw)
409-
396+
local playerPos = entities.GetLocalPlayer():GetAbsOrigin()
397+
local forwardVec = engine.GetViewAngles():Forward()
398+
399+
targetAngle = math.deg(math.atan(targetPos.y - playerPos.y, targetPos.x - playerPos.x))
400+
local viewAngle = math.deg(math.atan(forwardVec.y, forwardVec.x))
401+
TargetAngle = math.floor(targetAngle - viewAngle)
402+
403+
local yaw
404+
405+
--Fake angle
406+
if not atenemy:GetValue() then
407+
yaw = Jitter_Fake
408+
else
409+
yaw = TargetAngle + Jitter_Fake
410+
end
411+
412+
-- Clamp the yaw angle if it's greater than 180 or less than -180
413+
if yaw > 180 then
414+
yaw = yaw - 360
415+
elseif yaw < -180 then
416+
yaw = yaw + 360
417+
end
418+
419+
Jitter_Fake1 = yaw - TargetAngle
420+
yaw = math.floor(yaw)
421+
gui.SetValue("Anti Aim - Custom Yaw (Fake)", yaw)
410422

411-
if not atenemy then
412-
yaw = jitter_Real
423+
--Real angle
424+
if not atenemy:GetValue() then
425+
yaw = jitter_Real
426+
else
427+
428+
if pitchDowned then
429+
yaw = TargetAngle - jitter_Real + 180
413430
else
414431
yaw = TargetAngle - jitter_Real
415432
end
416-
-- Clamp the yaw angle if it's greater than 180 or less than -180
417-
if yaw > 180 then
418-
yaw = yaw - 360
419-
elseif yaw < -180 then
420-
yaw = yaw + 360
421-
end
422-
Jitter_Real1 = yaw - TargetAngle
423-
yaw = math.floor(yaw)
424-
gui.SetValue("Anti Aim - Custom Yaw (Real)", yaw)
433+
end
434+
435+
-- Clamp the yaw angle if it's greater than 180 or less than -180
436+
if yaw > 180 then
437+
yaw = yaw - 360
438+
elseif yaw < -180 then
439+
yaw = yaw + 360
440+
end
441+
442+
Jitter_Real1 = yaw - TargetAngle
443+
yaw = math.floor(yaw)
444+
gui.SetValue("Anti Aim - Custom Yaw (Real)", yaw)
445+
446+
447+
-- Clamp the yaw angle if it's greater than 180 or less than -180
448+
if yaw > 180 then
449+
yaw = yaw - 360
450+
elseif yaw < -180 then
451+
yaw = yaw + 360
452+
end
453+
Jitter_Real1 = yaw - TargetAngle
454+
yaw = math.floor(yaw)
455+
gui.SetValue("Anti Aim - Custom Yaw (Real)", yaw)
456+
425457
end
426458
::continue::
427459
end
@@ -432,9 +464,13 @@ local function OnCreateMove(userCmd)
432464
local pLocal = entities.GetLocalPlayer()
433465
if not pLocal then return end
434466
if not pLocal:IsAlive() then return end
435-
467+
pitchtype1 = gui.GetValue("Anti Aim - Pitch")
436468
local pLocalOrigin = pLocal:GetAbsOrigin() + Vector3(0, 0, 75)
437-
469+
if pitchType == 3 or pitchtype1 == "fake up" or pitchtype1 == "down" then
470+
pitchDowned = true
471+
else
472+
pitchDowned = false
473+
end
438474
local Jitter_Min_Real = -Jitter_Range_Real1
439475
local Jitter_Max_Real = Jitter_Range_Real1
440476

@@ -443,7 +479,7 @@ local function OnCreateMove(userCmd)
443479
--auto adds playerlist priority
444480
if mAutoPriority:GetValue() then
445481
for _, vPlayer in pairs(players) do
446-
if vPlayer ~= nil and vPlayer:IsAlive() and vPlayer:GetTeamNumber() ~= pLocal:GetTeamNumber() then
482+
if vPlayer ~= nil and vPlayer:GetTeamNumber() ~= pLocal:GetTeamNumber() then
447483
if playerlist.GetPriority(vPlayer) == 0 then
448484
playerlist.SetPriority(vPlayer, 10)
449485
end
@@ -491,6 +527,8 @@ local function OnCreateMove(userCmd)
491527
else
492528
currentTarget = pLocal:GetAbsOrigin()
493529
end
530+
local class = pLocal:GetPropInt("m_iClass")
531+
494532
local pWeapon = me:GetPropEntity("m_hActiveWeapon")
495533
local AimbotTarget = GetBestTarget(me)
496534
--userCmd:SetViewAngles(currentTarget.angles:Unpack())
@@ -511,6 +549,7 @@ local function OnCreateMove(userCmd)
511549
Jitter_Max_Real = Jitter_Range_Real1
512550
if atenemy:GetValue() then
513551
jitter_Real = randomizeValue(Jitter_Min_Real, Jitter_Max_Real, Head_size)
552+
514553
jitter_real1 = jitter_Real
515554

516555
local Number1 = math.random(1, 3)
@@ -537,101 +576,60 @@ local function OnCreateMove(userCmd)
537576
gui.SetValue("Anti Aim - Custom Yaw (Fake)", YawFake)
538577
end]]
539578
end
540-
if RandomPitchtype:GetValue() then
541-
local min = 1
542-
local max = 4
543-
544-
-- TF_CLASS_SNIPER = 2,
545-
if downPitch:GetValue() == true then
546-
min = 1
547-
max = 2
548-
else
549-
min = 1
550-
max = 4
551-
end
552-
553-
--[[ TF_CLASS_SCOUT = 1,
554-
555-
if downPitch:GetValue() == true then
556-
min = 3
557-
max = 4
558-
else
559-
min = 1
560-
max = 2
561-
end
562-
563-
TF_CLASS_SOLDIER = 3,
564-
if class TF_CLASS_SOLDIER = 3,
565-
min = 1
566-
max = 2
567-
end
568-
569-
-- TF_CLASS_DEMOMAN = 4,
570-
if downPitch:GetValue() == true then
571-
min = 1
572-
max = 2
573-
else
574-
min = 1
575-
max = 4
576-
end
577-
578-
--TF_CLASS_MEDIC = 5,
579-
if downPitch:GetValue() == true then
580-
min = 3
581-
max = 4
582-
else
583-
min = 1
584-
max = 2
585-
end
586579

587-
-- TF_CLASS_HEAVYWEAPONS = 6,
588-
if downPitch:GetValue() == true then
589-
min = 1
590-
max = 2
591-
else
592-
min = 1
593-
max = 4
594-
end
595-
596-
TF_CLASS_PYRO = 7,
597-
if downPitch:GetValue() == true then
598-
min = 3
599-
max = 4
600-
else
601-
min = 1
602-
max = 2
603-
end
604-
605-
if TF_CLASS_SPY = 8,
606-
min = 1
607-
max = 2
608-
609-
min = 1
610-
max = 4
580+
if RandomPitchtype:GetValue() then
581+
if userCmd.command_number % mDelay:GetValue() == 0 then
582+
-- Define helper function to set min and max values based on pitch type
583+
local function setMinMax(pitchType)
584+
if pitchType == UNSAFE then
585+
return 1, 4 -- use all angles when downPitch is true
586+
elseif pitchType == BEST_UP then
587+
return 1, 2 -- use best angles otherwise
588+
elseif pitchType == BEST_DOWN then
589+
return 3, 4 -- use safer angles otherwise
590+
end
611591
end
612592

613-
--TF_CLASS_ENGINEER = 9,
614-
if downPitch:GetValue() == true then
615-
min = 3
616-
max = 4
617-
else
618-
min = 1
619-
max = 2
620-
end
621-
]]
622-
623-
number = math.random(min, max)
624-
if number == 1 then
625-
gui.SetValue("Anti Aim - Pitch", 1)
626-
elseif number == 2 then
627-
gui.SetValue("Anti Aim - Pitch", 4)
628-
elseif number == 3 then
629-
gui.SetValue("Anti Aim - Pitch", 2)
630-
else
631-
gui.SetValue("Anti Aim - Pitch", 3)
593+
-- Set initial values for min and max
594+
local min, max = setMinMax(BEST)
595+
min, max = setMinMax(UNSAFE)
596+
-- Set pitch type based on class and downPitch value
597+
if not downPitch:GetValue() then
598+
pitchType = UNSAFE
599+
elseif class == 1 then -- TF_CLASS_scout
600+
pitchType = BEST_DOWN
601+
elseif class == 2 then -- TF_CLASS_sniper
602+
pitchType = BEST_UP
603+
elseif class == 3 then -- TF_CLASS_SOLDIER
604+
pitchType = UNSAFE
605+
elseif class == 4 then -- TF_CLASS_DEMOMAN
606+
pitchType = BEST_DOWN
607+
elseif class == 5 then -- TF_CLASS_MEDIC
608+
pitchType = BEST_DOWN
609+
elseif class == 6 then -- TF_CLASS_HEAVYWEAPONS
610+
pitchType = BEST_UP
611+
elseif class == 7 then -- TF_CLASS_PYRO
612+
pitchType = BEST_DOWN
613+
elseif class == 8 then -- TF_CLASS_SPY
614+
pitchType = BEST_DOWN
615+
elseif class == 9 then -- TF_CLASS_ENGINEER
616+
pitchType = BEST_DOWN
617+
end
618+
619+
-- Set min and max values based on pitch type
620+
min, max = setMinMax(pitchType)
621+
622+
number = math.random(min, max)
623+
if number == 1 then
624+
gui.SetValue("Anti Aim - Pitch", 1)
625+
elseif number == 2 then
626+
gui.SetValue("Anti Aim - Pitch", 4)
627+
elseif number == 3 then
628+
gui.SetValue("Anti Aim - Pitch", 2)
629+
else
630+
gui.SetValue("Anti Aim - Pitch", 3)
631+
end
632632
end
633-
else
634-
gui.SetValue("Anti Aim - Pitch", 1)
635633
end
636634
end
637635

@@ -674,7 +672,6 @@ local function OnDraw()
674672
else
675673
yaw = targetAngle + Jitter_Real1
676674
end
677-
678675
if targetAngle then
679676
direction = Vector3(math.cos(math.rad(yaw)), math.sin(math.rad(yaw)), 0)
680677
end

0 commit comments

Comments
 (0)