Skip to content

Commit 89d2b00

Browse files
v2.9.0
auto crit refill
1 parent 3df9a64 commit 89d2b00

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Swing_Prediction.lua

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ menu.Style.Outline = true -- Outline around the menu
2323
end, ItemFlags.FullWidth))]]
2424
local debug = menu:AddComponent(MenuLib.Checkbox("indicator", false))
2525
local Swingpred = menu:AddComponent(MenuLib.Checkbox("Enable", true))
26+
local mAutoRefill = menu:AddComponent(MenuLib.Checkbox("Auto Crit Refill", true))
2627
local mKillaura = menu:AddComponent(MenuLib.Checkbox("Killaura (soon)", false))
2728
local mtime = menu:AddComponent(MenuLib.Slider("movement ahead", 100 ,295 , 245 ))
2829
local msamples = menu:AddComponent(MenuLib.Slider("Velocity Samples", 1 ,777 , 132 ))
@@ -225,7 +226,6 @@ local function OnCreateMove(pCmd, cmd)
225226
local players = entities.FindByClass("CTFPlayer") -- Create a table of all players in the game
226227

227228
if not isMelee then return end
228-
229229
--try get vierwhegiht without crash
230230
if pLocalClass ~= pLocalClasslast then
231231
pLocalOrigin = GetViewHeight()
@@ -235,8 +235,9 @@ if not isMelee then return end
235235
if closestPlayer == nil then goto continue end
236236
if closestDistance == 1200 then goto continue end
237237
vPlayerOrigin = closestPlayer:GetAbsOrigin()
238-
238+
vdistance = (vPlayerOrigin - pLocalOrigin):Length()
239239
local Killaura = mKillaura:GetValue()
240+
240241
--[[position prediction]]--
241242
if tick % 8 == 0 or tick == nil then
242243
tick = 0
@@ -255,27 +256,29 @@ if not isMelee then return end
255256
local dynamicstop = swingrange + 10
256257
if (pCmd.forwardmove == 0) then dynamicstop = swingrange - 10 end -- case if you dont hold w when charging
257258

258-
vdistance = (vPlayerOrigin - pLocalOrigin):Length()
259259
if pLocalClass == 4 and vdistance <= dynamicstop then
260260
pCmd:SetButtons(pCmd:GetButtons() | IN_ATTACK)
261261
end
262262
end
263263

264264
--wall check
265265
local can_attack = false
266-
266+
print(pWeapon:GetCritTokenBucket())
267267
local trace = engine.TraceLine(pLocalFuture, vPlayerOrigin, MASK_SHOT_HULL)
268268
if (trace.entity:GetClass() == "CTFPlayer") and (trace.entity:GetTeamNumber() ~= pLocal:GetTeamNumber()) then
269269
can_attack = isWithinHitbox(GetTriggerboxMin(swingrange, vPlayerFuture), GetTriggerboxMax(swingrange, vPlayerFuture), pLocalFuture, vPlayerFuture)
270270
end
271-
272271
--Attack when futere position is inside attack range triggerbox
273272
if isMelee and not stop and can_attack then
274273
pCmd:SetButtons(pCmd:GetButtons() | IN_ATTACK)
275274
if mKillaura:GetValue() == true and warp.GetChargedTicks() >= 22 then
276275
warp.TriggerWarp()
277276
--warp.TriggerDoubleTap()
278277
end
278+
elseif isMelee and not stop and pWeapon:GetCritTokenBucket() <= 27 and mAutoRefill:GetValue() == true then
279+
if vdistance > 400 then
280+
pCmd:SetButtons(pCmd:GetButtons() | IN_ATTACK)--refill
281+
end
279282
end
280283

281284
-- Update last variables

0 commit comments

Comments
 (0)