UI.AddSubTab(["Config", "SUBTAB_MGR"], "Fake Lag");
UI.AddSliderInt(["Config", "Fake Lag", "Fake Lag"],"Send Limit", 0, 16)
UI.AddSliderInt(["Config", "Fake Lag", "Fake Lag"],"Choke Limit", 0, 16)
var tickcount = 0
var flip = false
function onCM()
{
var send = UI.GetValue(["Config", "Fake Lag", "Fake Lag","Send Limit"])
var choke = UI.GetValue(["Config", "Fake Lag", "Fake Lag","Choke Limit"])
if(tickcount >= choke && !flip)
{
flip = true
tickcount = 0
}
if(tickcount >= send && flip)
{
flip = false
tickcount = 0
}
UI.SetValue(["Rage","Fake Lag","General","Limit"], !flip ? choke : 0)
tickcount++
}
function roundstart()
{
tickcount = 0
}
Cheat.RegisterCallback("round_start", "roundstart")
Cheat.RegisterCallback("CreateMove", "onCM")
function guishit()
{
UI.AddSliderFloat(["Config", "Fake Lag", "Fake Lag"],"Max fakelag limit", 0, 16);
UI.AddSliderFloat(["Config", "Fake Lag", "Fake Lag"],"Switch frequency", 0.01, 1);
UI.AddSliderFloat(["Config", "Fake Lag", "Fake Lag"],"Central value", 0, 16);
}
function fakelags()
{
var curtime = Global.Realtime();
var limit = UI.GetValue(["Config", "Fake Lag", "Fake Lag","Max fakelag limit"]);
var freq = UI.GetValue(["Config", "Fake Lag", "Fake Lag","Switch frequency"]);
var center = UI.GetValue(["Config", "Fake Lag", "Fake Lag","Central value"]);
var fl = (limit*Math.cos((curtime)/freq) + center);
return fl;
}
function push()
{
UI.SetValue(["Config", "Fake Lag", "Fake Lag","Send Limit"], fakelags());
}
guishit();
Global.RegisterCallback("Draw", "push");