ЧВК EB_LAN
Эксперт
-
Автор темы
- #1
code_language.lua:
local Get = gui.get_config_item
local AddCheckbox = gui.add_checkbox
local AddSlider = gui.add_slider
local AddCombo = gui.add_combo
function Clamp(x, min, max)
if min > max then
return math.min(math.max(x, max), min)
else
return math.min(math.max(x, min), max)
end
return x
end
local OverrideAntiaim = AddCheckbox("Override antiaim", "lua>tab b>")
local AntiaimPreset = AddCombo("Preset", "lua>tab b>", {"None", "Nervous jitter", "Low jitter", "Nervous spin"})
local Antiaim = {
OriginalYaw = AddSlider("Original yaw", "lua>tab b>", -58, 58, 0),
OverrideYaw = Get("Rage>Anti-Aim>Angles>Yaw add"),
YawAmount = Get("Rage>Anti-Aim>Angles>Add"),
OverrideSpin = Get("Rage>Anti-Aim>Angles>Spin"),
SpinAmount = Get("Rage>Anti-Aim>Angles>Spin range"),
SpinSpeed = Get("Rage>Anti-Aim>Angles>Spin speed"),
OverrideJitter = Get("Rage>Anti-Aim>Angles>Jitter"),
JitterAmount = Get("Rage>Anti-Aim>Angles>Jitter Range"),
JitterRandomize = Get("Rage>Anti-Aim>Angles>Random"),
DesyncAmount = Get("Rage>Anti-Aim>Desync>Fake amount"),
DesyncCompensation = Get("Rage>Anti-Aim>Desync>Compensate angle"),
DesyncJitter = Get("Rage>Anti-Aim>Desync>Flip fake with jitter")
}
local function JitterSide()
local JitterSide = 0
local SwapTimer = 0
local Curtime = global_vars.curtime
SwapTimer = math.ceil(Curtime * 32) % 2
Clamp(SwapTimer, 0, 1)
JitterSide = SwapTimer > 0.5 and 1 or -1
return JitterSide
end
local function AntiaimSystem()
local Curtime = global_vars.curtime
if OverrideAntiaim:get_bool() then
if AntiaimPreset:get_int() == 1 then
Antiaim.OverrideSpin:set_bool(false)
Antiaim.YawAmount:set_int(Antiaim.OriginalYaw:get_int() + math.ceil(Curtime * 128) % 35 * JitterSide())
Antiaim.DesyncAmount:set_int(45 * JitterSide())
Antiaim.DesyncCompensation:set_int(25 + math.ceil(Curtime * 128) % 55)
end
if AntiaimPreset:get_int() == 2 then
Antiaim.OverrideSpin:set_bool(false)
Antiaim.YawAmount:set_int(Antiaim.OriginalYaw:get_int() + math.ceil(Curtime * utils.random_int(120, 128)) % 15 * JitterSide())
Antiaim.DesyncAmount:set_int(-45 - math.ceil(Curtime * 65) % 20)
Antiaim.DesyncCompensation:set_int(75 + math.ceil(Curtime * 65) % 20)
end
if AntiaimPreset:get_int() == 3 then
Antiaim.OverrideSpin:set_bool(true)
Antiaim.SpinAmount:set_int(math.ceil(Curtime * 128) % 35)
Antiaim.YawAmount:set_int(Antiaim.OriginalYaw:get_int() - Antiaim.SpinAmount:get_int())
Antiaim.DesyncAmount:set_int(-60)
Antiaim.DesyncCompensation:set_int(60)
end
end
end
function on_paint()
AntiaimSystem()
end