Skip to content

Commit e6e1fb5

Browse files
Add files via upload
1 parent 6ceebbf commit e6e1fb5

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

A_Swing_Prediction.lua

+21-26
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ local function LoadCFG(folder_name)
175175
local content = file:read("*a")
176176
file:close()
177177
local chunk, err = load("return " .. content)
178-
if chunk then
178+
if chunk and not input.IsButtonDown(KEY_LSHIFT) then
179179
printc(0, 255, 140, 255, "[" .. os.date("%H:%M:%S") .. "] Loaded Config from " .. tostring(fullPath))
180180
return chunk()
181181
else
@@ -213,19 +213,6 @@ end
213213
-- This ensures settings are properly initialized even after loading the config
214214
SafeInitMenu()
215215

216-
-- Synchronize duplicated settings to avoid conflicts
217-
local function SyncSettings()
218-
-- Synchronize ChargeBot setting (exists in both Aimbot and Charge sections)
219-
if Menu.Charge.ChargeBot ~= Menu.Aimbot.ChargeBot then
220-
-- Prefer the Charge tab setting as it's the proper location
221-
Menu.Aimbot.ChargeBot = Menu.Charge.ChargeBot
222-
print("Synchronized ChargeBot settings")
223-
end
224-
end
225-
226-
-- Run synchronization after loading config
227-
SyncSettings()
228-
229216
local isMelee = false
230217
local pLocal = nil
231218
local players = entities.FindByClass("CTFPlayer")
@@ -1316,13 +1303,8 @@ local function OnCreateMove(pCmd)
13161303
dashKeyBound = gui.GetValue("dash move key") ~= 0
13171304
local canInstantAttack = Menu.Misc.InstantAttack and warp.CanWarp() and warp.GetChargedTicks() >= 13 and dashKeyBound
13181305

1319-
-- Temporarily disable charge reach if instant attack is ready
1320-
local tempChargeReach = Menu.Misc.ChargeReach
1321-
if canInstantAttack then
1322-
Menu.Misc.ChargeReach = false
1323-
end
1324-
1325-
-- Distance check and target range check
1306+
-- No need to temporarily store ChargeReach - directly check it when needed
1307+
-- Get distance check and target range check
13261308
-- Get current distance between local player and closest player
13271309
Vdistance = (vPlayerOrigin - pLocalOrigin):Length()
13281310

@@ -1337,8 +1319,7 @@ local function OnCreateMove(pCmd)
13371319
can_attack = inRange
13381320

13391321
--[--------------AimBot-------------------] --get hitbox of ennmy pelwis(jittery but works)
1340-
hitboxes = CurrentTarget:GetHitboxes()
1341-
hitbox = hitboxes[6]
1322+
13421323
aimpos = nil
13431324
--else
13441325
aimpos = CurrentTarget:GetAbsOrigin() +
@@ -1397,7 +1378,7 @@ local function OnCreateMove(pCmd)
13971378
local weaponData = pWeapon:GetWeaponData()
13981379
if weaponData and weaponData.smackDelay then
13991380
-- Convert smackDelay time to ticks (rounded up to ensure we have enough time)
1400-
weaponSmackDelay = math.ceil(weaponData.smackDelay / globals.TickInterval())
1381+
weaponSmackDelay = math.floor(weaponData.smackDelay / globals.TickInterval())
14011382
-- Ensure a minimum viable value
14021383
weaponSmackDelay = math.max(weaponSmackDelay, 5)
14031384

@@ -1485,8 +1466,7 @@ local function OnCreateMove(pCmd)
14851466
can_attack = false
14861467
end
14871468

1488-
-- Restore original charge reach setting
1489-
Menu.Misc.ChargeReach = tempChargeReach
1469+
-- No need to restore any ChargeReach setting as we're not temporarily changing it
14901470

14911471
if can_charge then
14921472
if Menu.Misc.ChargeJump and input.IsButtonPressed(MOUSE_RIGHT) and OnGround then
@@ -2203,15 +2183,30 @@ local function doDraw()
22032183
ImMenu.EndFrame()
22042184

22052185
ImMenu.BeginFrame(1)
2186+
local oldChargeControl = Menu.Charge.ChargeControl
22062187
Menu.Charge.ChargeControl = ImMenu.Checkbox("Charge Control", Menu.Charge.ChargeControl)
2188+
-- If the value changed, synchronize with the Misc setting
2189+
if oldChargeControl ~= Menu.Charge.ChargeControl then
2190+
Menu.Misc.ChargeControl = Menu.Charge.ChargeControl
2191+
end
22072192
ImMenu.EndFrame()
22082193

22092194
ImMenu.BeginFrame(1)
2195+
local oldChargeReach = Menu.Charge.ChargeReach
22102196
Menu.Charge.ChargeReach = ImMenu.Checkbox("Charge Reach", Menu.Charge.ChargeReach)
2197+
-- If the value changed, synchronize with the Misc setting
2198+
if oldChargeReach ~= Menu.Charge.ChargeReach then
2199+
Menu.Misc.ChargeReach = Menu.Charge.ChargeReach
2200+
end
22112201
ImMenu.EndFrame()
22122202

22132203
ImMenu.BeginFrame(1)
2204+
local oldChargeJump = Menu.Charge.ChargeJump
22142205
Menu.Charge.ChargeJump = ImMenu.Checkbox("Charge Jump", Menu.Charge.ChargeJump)
2206+
-- If the value changed, synchronize with the Misc setting
2207+
if oldChargeJump ~= Menu.Charge.ChargeJump then
2208+
Menu.Misc.ChargeJump = Menu.Charge.ChargeJump
2209+
end
22152210
ImMenu.EndFrame()
22162211
end
22172212

0 commit comments

Comments
 (0)