Skip to content

Commit 0fe1f1c

Browse files
v3.3.0
1 parent 6c8132b commit 0fe1f1c

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

Swing_Prediction.lua

+24-17
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ end, ItemFlags.FullWidth))]]
2525

2626
local Swingpred = menu:AddComponent(MenuLib.Checkbox("Enable", true))
2727
local mAutoRefill = menu:AddComponent(MenuLib.Checkbox("Crit Refill", true))
28-
local debug = menu:AddComponent(MenuLib.Checkbox("visuals", false))
29-
local mAirduck = menu:AddComponent(MenuLib.Checkbox("Air duck", false))
28+
local debug = menu:AddComponent(MenuLib.Checkbox("Visuals", true))
29+
local mAutoGarden = menu:AddComponent(MenuLib.Checkbox("Auto Troldier", false))
3030
local mKillaura = menu:AddComponent(MenuLib.Checkbox("Killaura (soon)", false))
3131
local mtime = menu:AddComponent(MenuLib.Slider("attack distance", 150 ,300 , 250 ))
3232

@@ -232,6 +232,26 @@ local function OnCreateMove(pCmd, cmd)
232232
if pLocalClass == 8 then return end
233233
local pWeapon = pLocal:GetPropEntity("m_hActiveWeapon")
234234
local swingrange = pWeapon:GetSwingRange() -- + 11.17
235+
local flags = pLocal:GetPropInt( "m_fFlags" )
236+
237+
if mAutoGarden:GetValue() == true then
238+
local state = ""
239+
if flags & FL_ONGROUND == 0 then
240+
state = "slot3"
241+
else
242+
state = "slot1"
243+
end
244+
if state then
245+
client.Command(state, true)
246+
end
247+
248+
if flags & FL_ONGROUND == 0 then
249+
pCmd:SetButtons(pCmd.buttons | IN_DUCK)
250+
else
251+
pCmd:SetButtons(pCmd.buttons & (~IN_DUCK))
252+
end
253+
end
254+
235255
-- Initialize closest distance and closest player
236256
isMelee = pWeapon:IsMeleeWeapon() -- check if using melee weapon
237257
local players = entities.FindByClass("CTFPlayer") -- Create a table of all players in the game
@@ -263,14 +283,8 @@ if not isMelee then return end
263283
vPlayerFuture = TargetPositionPrediction(vPlayerOrigin, vPlayerOriginLast, tickRate, time, tick)
264284
pLocalFuture = TargetPositionPrediction(pLocalOrigin, pLocalOriginLast, tickRate, time, tick)
265285
end
266-
local flags = pLocal:GetPropInt( "m_fFlags" );
267-
if mAirduck:GetValue() == true then
268-
if flags & FL_ONGROUND == 0 then
269-
pCmd:SetButtons(pCmd.buttons | IN_DUCK)
270-
else
271-
pCmd:SetButtons(pCmd.buttons & (~IN_DUCK))
272-
end
273-
end
286+
287+
274288
--[[-----------------------------Swing Prediction------------------------------------------------------------------------]]
275289

276290
-- bypass problem with prior attacking with shield not beeign able to reach target..
@@ -308,13 +322,6 @@ if not isMelee then return end
308322
end
309323
end
310324

311-
local flags = pLocal:GetPropInt( "m_fFlags" );
312-
313-
--[[if flags & IN_ATTACK == 1 then
314-
pCmd:SetButtons(pCmd.buttons | IN_JUMP)
315-
else
316-
pCmd:SetButtons(pCmd.buttons & (~IN_JUMP))
317-
end]]
318325

319326
-- Update last variables
320327
vPlayerOriginLast = vPlayerOrigin

0 commit comments

Comments
 (0)