UI.AddSliderInt(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General"], "Shift amount", 0, 150)
UI.AddSliderInt(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General"], "Tolerance", 0, 20)
UI.AddSliderInt(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General"], "Max process ticks", 0, 20)
UI.AddCheckbox(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General"], "Automatic Shift")
UI.AddCheckbox(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General"], "Automatic Tolerance")
UI.AddCheckbox(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General"], "Automatic max process ticks")
function cm() {
    var local = Entity.GetLocalPlayer()
    var info = Entity.GetCCSWeaponInfo(local)
    var time = info.cycle_time
    var ticks = Math.round(time / Globals.TickInterval())
    var automatic_shift = UI.GetValue(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General", "Automatic Shift"])
    var automatic_tolerance = UI.GetValue(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General", "Automatic Tolerance"])
    var automatic_mpt = UI.GetValue(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General", "Automatic max process ticks"])
    var maxprocessticks = UI.GetValue(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General", "Max process ticks"])
    var shift = UI.GetValue(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General", "Shift amount"])
    var tolerance = UI.GetValue(["Rage", "SUBTAB_MGR", "Exploits", "SHEET_MGR", "General", "Tolerance"])
    if(automatic_shift) {
        shift = ticks
    }
    if(automatic_tolerance) {
        tolerance = Math.round(Local.Latency() / Globals.TickInterval()) - 2
    }
    if(automatic_mpt) {
        maxprocessticks = 16 // or maxprocessticks = ticks
    }
    shift = Math.max(Math.min(shift, maxprocessticks), 0)
    Exploit.OverrideMaxProcessTicks(maxprocessticks)
    Exploit.OverrideShift(shift)
    Exploit.OverrideTolerance(tolerance)
}
Cheat.RegisterCallback("CreateMove", "cm")