UI.AddLabel("OnlyH$.win")
UI.AddLabel("")
UI.AddColorPicker("Watermark");
var color = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Watermark");

if (color[3] == 0)
	UI.SetColor("Misc", "JAVASCRIPT", "Script items", "Watermark", [89, 119, 239, 255]);

function draw() {
	if(!World.GetServerString())
		return;

	var today = new Date();
    var hours1 = today.getHours();
    var minutes1 = today.getMinutes();
	var seconds1 = today.getSeconds();
	
    var hours = hours1 <= 9 ? "0"+hours1+":" : hours1+":";
    var minutes = minutes1 <= 9 ? "0" + minutes1+":" : minutes1+":";
	var seconds = seconds1 <= 9 ? "0" + seconds1 : seconds1;
	
	var server_tickrate = Globals.Tickrate().toString()
	var ebanaya_hueta = Math.round(Entity.GetProp(Entity.GetLocalPlayer(), "CPlayerResource", "m_iPing")).toString() // кто это сделал - контуженный на всю голову ебаный хуесос

	color = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Watermark");

	var font = Render.AddFont("Verdana", 7, 400);
	var text = "OnlyH$.win [1337:1:1] | " + Cheat.GetUsername() + " | delay: " + ebanaya_hueta + "ms | " + server_tickrate + "tick | " + hours + minutes + seconds;
	
	var w = Render.TextSizeCustom(text, font)[0] + 8;
	var x = Global.GetScreenSize()[0];

	x = x - w - 10;

	Render.FilledRect(x, 10, w, 2, [ color[0], color[1], color[2], 255 ]);
	Render.FilledRect(x, 12, w, 18, [ 17, 17, 17, color[3] ]);
	Render.StringCustom(x+4, 10 + 4, 0, text, [ 255, 255, 255, 255 ], font);
}

Cheat.RegisterCallback("Draw", "draw");
UI.AddLabel("")
UI.AddLabel("----[RAGEBOT]----")
UI.AddCheckbox("Better Resolver(TEST)")
UI.AddCheckbox("Better doubletap");

function on_ragebot_fire()
{ 
    
    ragebot_target_exploit = Event.GetInt("exploit");
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Better doubletap"))
    {
        if (ragebot_target_exploit == 2)
        {
            UI.SetValue("Rage", "GENERAL", "Exploits", "Doubletap fast recovery", true);
        }
        else
        {
            UI.SetValue("Rage", "GENERAL", "Exploits", "Doubletap fast recovery", false);
        }
    }
            
}

Global.RegisterCallback("ragebot_fire", "on_ragebot_fire");
UI.AddCheckbox( "Wait for on shot" );
UI.AddHotkey( "Wait for on shot key" );
var last_shot_time = []
function on_create_move()
{
  if(!UI.GetValue("Misc", "Wait for on shot") || !UI.IsHotkeyActive("Misc","Wait for on shot key")) return;

  var local = Entity.GetLocalPlayer( );
  if(!Entity.IsAlive(local)) return;
  var enemies = Entity.GetEnemies();

  for(var i = 0; i < enemies.length;i++)
  {
    var enemy = enemies[i];
    var dif = Globals.Tickcount() - last_shot_time[enemy]
    var has_shot = dif >= 0 && dif <= 12;
    if(!has_shot)
      Ragebot.IgnoreTarget(enemy)
  }

}
function on_weapon_fire()
{
  var shooter = Entity.GetEntityFromUserID(Event.GetInt("userid"));
  last_shot_time[shooter] = Globals.Tickcount();
}

function on_player_connect()
{
  var entity = Entity.GetEntityFromUserID(Event.GetInt("userid"));
  if(entity == Entity.GetLocalPlayer())
    last_shot_time = []
}


Cheat.RegisterCallback("weapon_fire", "on_weapon_fire")
Cheat.RegisterCallback("player_connect_full", "on_player_connect")
Cheat.RegisterCallback("CreateMove","on_create_move")

UI.AddLabel("")
UI.AddLabel("Min Dmg Override")

UI.AddCheckbox("Display indicator")
UI.AddHotkey("Heavy Pistol Override")
UI.AddSliderInt("Heavy Pistol Mindmg", 0, 130)
UI.AddHotkey("Scout Override")
UI.AddSliderInt("Scout Mindmg", 0, 130)
UI.AddHotkey("AWP Override")
UI.AddSliderInt("AWP Mindmg", 0, 130)
UI.AddHotkey("Auto Override")
UI.AddSliderInt("Auto Mindmg", 0, 130)

var heavy_cache = UI.GetValue("Rage", "HEAVY PISTOL", "Targeting", "Minimum damage")
var scout_cache = UI.GetValue("Rage", "SCOUT", "Targeting", "Minimum damage")
var awp_cache = UI.GetValue("Rage", "AWP", "Targeting", "Minimum damage")
var auto_cache = UI.GetValue("Rage", "AUTOSNIPER", "Targeting", "Minimum damage")
function isActive(a)
{
    return UI.IsHotkeyActive("Script items", a)
}
function setValue(cat, value)
{
    UI.SetValue("Rage", cat.toUpperCase(), "Targeting", "Minimum damage", value)
}
function isHeavyPistol(name)
{
    if (name == "r8 revolver" || name == "desert eagle")
    {
        return true
    }
}
function isAutoSniper(name)
{
    if(name == "scar 20" || weapon_name == "g3sg1")
    {
        return true
    }
}
function onCM()
{
    heavy_value = UI.GetValue("Script items", "Heavy Pistol Mindmg")
    scout_value = UI.GetValue("Script items", "Scout Mindmg")
    awp_value = UI.GetValue("Script items", "AWP Mindmg")
    auto_value = UI.GetValue("Script items", "Auto Mindmg")
    weapon_name = Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))
    
    if (isActive("Heavy Pistol Override") && isHeavyPistol(weapon_name))
    {
        setValue("HEAVY PISTOL", heavy_value)
    }
    else{
        setValue("HEAVY PISTOL", heavy_cache)
    }
    
    if (isActive("Scout Override") && weapon_name == "ssg 08")
    {
        setValue("SCOUT", scout_value)
    }
    else{
        setValue("SCOUT", scout_cache)
    }

    if (isActive("AWP Override") && weapon_name == "awp")
    {
        setValue("AWP", awp_value)
    }
    else{
        setValue("AWP", awp_cache)
    }

    if (isActive("Auto Override") && isAutoSniper(weapon_name))
    {
        
        setValue("AUTOSNIPER", auto_value)
    }
    else
    {
        setValue("AUTOSNIPER", auto_cache)
    }
    
}
function indicator()
{
    font = Render.AddFont("Tahoma", 20,600 )
    screen = Render.GetScreenSize()
    wep = Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))
    x = screen[0]-screen[0] + 25
    y = screen[1] - 80
    heavy ="" + UI.GetValue("Rage", "HEAVY PISTOL", "Targeting", "Minimum damage")
    scout ="" +UI.GetValue("Rage", "SCOUT", "Targeting", "Minimum damage")
    awp ="" +UI.GetValue("Rage", "AWP", "Targeting", "Minimum damage")
    auto ="" +UI.GetValue("Rage", "AUTOSNIPER", "Targeting", "Minimum damage")
    var str = ""
    if (UI.GetValue("Script items", "Display indicator") && Entity.IsValid(Entity.GetLocalPlayer()) && Entity.IsAlive(Entity.GetLocalPlayer()))
    {
        if (isHeavyPistol(wep))
        {
            str = heavy
        }
        else if(wep == "ssg 08")
        {
            str = scout
        }
        else if(wep == "awp")
        {
            str = awp
        }
        else if (isAutoSniper(wep))
        {
            str = auto
        }
    }
    
    if (str == "" + 0)
    {
        str = "DYNAMIC"
    }
    Render.StringCustom(x+1, y+1, 0, str+"", [0,0,0,255], font)
    Render.StringCustom(x, y, 0, str+"", [255,255,255,255], font)
}
Cheat.RegisterCallback("Draw", "indicator")
Cheat.RegisterCallback("CreateMove", "onCM")

UI.AddLabel("")
UI.AddLabel("----[ANTIAIM]----")
UI.AddLabel("")
UI.AddCheckbox("Low delta");
UI.AddDropdown( "Low delta type", [ "Custom", "On key" ] );
const lowdelta_modes = UI.AddMultiDropdown("Low delta modes", [ "Slow walk", "Low HP", "Standing" ]);
UI.AddHotkey("Low delta on key");

function SetEnabled()
{
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta"))
    {
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta type", 1)
    }
    else
    {
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta type", 0)
    }

    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta type") == 0 && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta"))
    {
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta modes", 1)
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta on key", 0)
    }
    else if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta type") == 1 && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta"))
    {
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta modes", 0)
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta on key", 1)
    }
    else
    {
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta modes", 0)
       UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Low delta on key", 0)
    }
}

function get_velocity(index)
{
    var velocity = Entity.GetProp(index, "CBasePlayer", "m_vecVelocity[0]");
    return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
}

function get_health(index)
{
    health_override = Entity.GetProp(index, "CBasePlayer", "m_iHealth");
    return health_override;
}

function Low_delta()
{
	localplayer_index = Entity.GetLocalPlayer( );
	const lowdelta_dropdown_value = UI.GetValue.apply(null, lowdelta_modes);
	
	var velocity = get_velocity(localplayer_index)
    var health = get_health(localplayer_index)
	var LowHP = false
    var SlowWalk = false
	var Standing = false
	var Onkey = false

	if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta") && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta type") == 0)
	{
	   if (lowdelta_dropdown_value & (1 << 0) && UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk"))
       SlowWalk = true
       else
       SlowWalk = false

       if (lowdelta_dropdown_value & (1 << 1) && health < 50)
       LowHP = true
       else
       LowHP = false

       if (lowdelta_dropdown_value & (1 << 2) && velocity < 3)
       Standing = true
       else
       Standing = false
	}
    else if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta") && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta type") == 1)
	{
	   if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Low delta on key"))
       Onkey = true
       else
       Onkey = false
	}
   
        if (Standing == true || LowHP == true || SlowWalk == true || Onkey == true && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta"))
        {
			UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", 10);
			UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Jitter offset", 0);
            AntiAim.SetOverride(1);
            AntiAim.SetFakeOffset(0);
            AntiAim.SetRealOffset(-20);
		}
        else
		{
			UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", 0);
            AntiAim.SetOverride(0);
		}
}

function drawString()
{
    const fontpixel = Render.AddFont( "Verdana", 8, 100);
    const lowdelta_dropdown_value = UI.GetValue.apply(null, lowdelta_modes);
    var SFOnkey = false
    var screen_size = Global.GetScreenSize();

    localplayer_index = Entity.GetLocalPlayer( );
    localplayer_alive = Entity.IsAlive( localplayer_index );

    SlowWalk = false
    LowHP = false
    Standing = false
    Onkey = false

    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta") && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta type") == 0)
	{
	   if (lowdelta_dropdown_value & (1 << 0) && UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk"))
       SlowWalk = true
       else
       SlowWalk = false

       if (lowdelta_dropdown_value & (1 << 1) && health < 50)
       LowHP = true
       else
       LowHP = false

       if (lowdelta_dropdown_value & (1 << 2) && velocity < 3)
       Standing = true
       else
       Standing = false
	}
    else if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta") && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta type") == 1)
	{
	   if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Low delta on key"))
       Onkey = true
       else
       Onkey = false
    }
    
    if (Standing == true || LowHP == true || SlowWalk == true || Onkey == true)
    {
        drawIND = true
    }
    else
    {
        drawIND = false
    }
    
    if (drawIND == true && localplayer_alive == true && UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low delta") == true)
	{
	   Render.StringCustom(screen_size[0] /2 , screen_size[1] /2 +25, 1, "LOW DELTA", [ 255, 0, 0, 255 ], fontpixel );
    }
}

Global.RegisterCallback("Draw", "drawString");
Global.RegisterCallback("Draw", "SetEnabled");
Cheat.RegisterCallback("CreateMove", "Low_delta");

UI.AddLabel("")

function addtomenu(){
//    UI.AddSliderInt("YAW Offset #1",-180, 180);
 //   UI.AddSliderInt("JITTER Offset #1",-180, 180);
 //   UI.AddSliderInt("YAW Offset #2",-180, 180);
 //   UI.AddSliderInt("JITTER Offset #2",-180, 180);
 //   UI.AddSliderInt("YAW Offset #3",-180, 180);
 //   UI.AddSliderInt("JITTER Offset #3",-180, 180);    
    UI.AddLabel("--------------------------");
    UI.AddDropdown( "Lagsync", [ "Off", "On"] );
    UI.AddDropdown( "Lagsync mode", [ "Off", "Lagsync V1", "Lagsync V2", "dema6r Lagsync" ] );
    UI.AddDropdown( "Breaker", [ "Off", "Breaker V1", "Breaker V2" ] );
    UI.AddLabel("--------------------------");
 //   UI.AddSliderFloat("SWITCH delay",0, 5);
}
var aa=1;
var aad=1;
var lasttime = Global.Realtime();
var realtime = Global.Realtime();
var yawoffset =UI.GetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset");
var jitteroffset =UI.GetValue("Anti-Aim", "Rage Anti-Aim", "Jitter offset");
var de=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay");
var status=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH Way");
var yawnewoffset;

function randomIntFrom(min,max) // Get a random integer from [min] to [max]
{
    return Math.floor(Math.random()*(max-min+1)+min);
}

// -------------------------------------------------------------------- LAGSYNC V1 --------------------------------------------------------------------

function V1(){
    // Disable Breaker
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Breaker", 0);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", -10);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", false);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 0);
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 15);
    
}
function V2(){
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", -25);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 1);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 5);
    
}
function V3(){
    
    // Fake Angles
    
//    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 1);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", false);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 9);
    
}

// -------------------------------------------------------------------- LAGSYNC V2 --------------------------------------------------------------------

function S1(){
    // Disable Breaker
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Breaker", 0);

    yawnewoffset = randomIntFrom(-10, -20);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", false);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
}
function S2(){
    // Disable Breaker

    yawnewoffset = randomIntFrom(-10, -20);

    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Breaker", 0);
        UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    
}

// -------------------------------------------------------------------- LAGSYNC V3 --------------------------------------------------------------------

function A1(){
    // Disable Breaker
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Breaker", 0);
    
    yawnewoffset = randomIntFrom(-24, 19);
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 11);
    
}
function A2(){
    // Disable Breaker
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Breaker", 0);
    
    yawnewoffset = randomIntFrom(-29,14);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", false);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 5);
    
}
function A3(){
    // Disable Breaker
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Breaker", 0);
    
    yawnewoffset = randomIntFrom(-19, 21);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 15);
    
}

// ----------------------------------------------------------------------------------------------------------------------------------------------------

// -------------------------------------------------------------------- Breaker V1 --------------------------------------------------------------------

function BR1(){
    // Disable Lagsync
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync mode", 0);
    
    yawnewoffset = randomIntFrom(-10, -20);
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 0);
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 15);
    
}
function BR2(){
    // Disable Lagsync
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync mode", 0);
    
    yawnewoffset = randomIntFrom(-15, -25);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 1);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", false);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 5);
    
}
function BR3(){
    // Disable Lagsync
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync mode", 0);

    yawnewoffset = randomIntFrom(-10, -10);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 9);
    
}

// ----------------------------------------------------------------------------------------------------------------------------------------------------

// -------------------------------------------------------------------- Breaker V2 --------------------------------------------------------------------

function BRR1(){
    // Disable Lagsync
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync mode", 0);
    
    yawnewoffset = randomIntFrom(-10, -34);
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 15);
    
}
function BRR2(){
    // Disable Lagsync
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync mode", 0);
    
    yawnewoffset = randomIntFrom(-16, -7);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", false);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 5);
    
}
function BRR3(){
    // Disable Lagsync
    UI.SetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync mode", 0);
    
    yawnewoffset = randomIntFrom(2, -4);
    
    // Fake Angles
    
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yawnewoffset);
    UI.SetValue("Anti-Aim", "Fake angles", "LBY mode", 2);
    UI.SetValue("Anti-Aim", "Fake angles", "Fake desync", true);
    UI.SetValue("Anti-Aim", "Fake angles", "Avoid overlap", true);
    
    // Fake Lag
    
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", 9);
    
}

// ----------------------------------------------------------------------------------------------------------------------------------------------------

function lagsyncmain() {
    mode=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync mode");
    breakermenu=UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "Breaker");
    
    if (mode==0) { lagsyncdisable(); }
    if (mode==1) { lagsyncv2(); }
    if (mode==2) { lagsyncv1(); }
    if (mode==3) { lagsyncv3(); }
    
    if (breakermenu==0) { breakerdisable(); }
    if (breakermenu==1) { breakerv1(); }
    if (breakermenu==2) { breakerv2(); }
}

function breakerv1() {
    status=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync");
    de=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay");
    realtime = Global.Realtime();
//    Global.Print(String(realtime-lasttime));
    if(realtime-lasttime>=de){
//        Global.Print(String(realtime-lasttime));
        if(status==1){
            aad=aa+1;
            if(aad>3){
                aad=1;
            }
            aa=aad;
        }
        if(aa==1){
           BR1();
        }
        if(aa==2){
            BR2();
        }
        if(aa==3){
            BR3();
        }
        lasttime = realtime;
    }
    if(realtime<lasttime){
        lasttime = Global.Realtime();
        realtime = Global.Realtime();
    }
}

function lagsyncdisable() {
    
}

function breakerv2() {
    status=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync");
    de=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay");
    realtime = Global.Realtime();
//    Global.Print(String(realtime-lasttime));
    if(realtime-lasttime>=de){
//        Global.Print(String(realtime-lasttime));
        if(status==1){
            aad=1+Math.floor(Math.random()*3);
            aa=aad;
//            Global.Print(String(aad));
        }
        if(status==2){
            aad=aa+1;
            if(aad>3){
                aad=1;
            }
            aa=aad;
//            Global.Print(String(aad));
        }
        if(aa==1){
           BRR1();
        }
        if(aa==2){
            BRR2();
        }
        if(aa==3){
            BRR3();
        }
        lasttime = realtime;
    }
    if(realtime<lasttime){
        lasttime = Global.Realtime();
        realtime = Global.Realtime();
    }
}

function breakerdisable() {
    
}

// --- THIS IS LAGSYNC V2 ---

function lagsyncv1() {
    status=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync");
    de=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay");
    realtime = Global.Realtime();
//    Global.Print(String(realtime-lasttime));
    if(realtime-lasttime>=de){
//        Global.Print(String(realtime-lasttime));
        if(status==1){
            aad=aa+1;
            if(aad>2){
                aad=1;
            }
            aa=aad;
//            Global.Print(String(aad));
        }
        if(aa==1){
           S1();
        }
        if(aa==2){
            S2();
        }
        lasttime = realtime;
    }
    if(realtime<lasttime){
        lasttime = Global.Realtime();
        realtime = Global.Realtime();
    }
}

// --- THIS IS LAGSYNC V1 ---

function lagsyncv2() {
    status=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync");
    de=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay");
    realtime = Global.Realtime();
//    Global.Print(String(realtime-lasttime));
    if(realtime-lasttime>=de){
//        Global.Print(String(realtime-lasttime));
        
        if(status==1){
            aad=aa+1;
            if(aad>3){
                aad=1;
            }
            aa=aad;
//            Global.Print(String(aad));
        }
        if(aa==1){
            V1();
        }
        if(aa==2){
            V2();
        }
        if(aa==3){
            V3();
        }
        lasttime = realtime;
    }
    if(realtime<lasttime){
        lasttime = Global.Realtime();
        realtime = Global.Realtime();
    }
}

// --- THIS IS LAGSYNC V3 ---

function lagsyncv3() {
    status=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync");
    de=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay");
    realtime = Global.Realtime();
//    Global.Print(String(realtime-lasttime));
    if(realtime-lasttime>=de){
//        Global.Print(String(realtime-lasttime));
        if(status==1){
            aad=1+Math.floor(Math.random()*3);
            aa=aad;
//            Global.Print(String(aad));
        }
        if(status==2){
            aad=aa+1;
            if(aad>3){
                aad=1;
            }
            aa=aad;
//            Global.Print(String(aad));
        }
        if(aa==1){
            A1();
        }
        if(aa==2){
            A2();
        }
        if(aa==3){
            A3();
        }
        lasttime = realtime;
    }
    if(realtime<lasttime){
        lasttime = Global.Realtime();
        realtime = Global.Realtime();
    }
}

function main(){
    status=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","Lagsync");
    de=UI.GetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay");
    realtime = Global.Realtime();
//    Global.Print(String(realtime-lasttime));
    if(realtime-lasttime>=de){
//        Global.Print(String(realtime-lasttime));
        if(status==1){
            aad=1+Math.floor(Math.random()*3);
            aa=aad;
//            Global.Print(String(aad));
        }
        if(status==2){
            aad=aa+1;
            if(aad>3){
                aad=1;
            }
            aa=aad;
//            Global.Print(String(aad));
        }
        if(aa==1){
            S1();
        }
        if(aa==2){
            S2();
        }
        if(aa==3){
            S3();
        }
        lasttime = realtime;
    }
    if(realtime<lasttime){
        lasttime = Global.Realtime();
        realtime = Global.Realtime();
    }
    
}

addtomenu();
UI.SetValue("Misc", "JAVASCRIPT", "Script Items","YAW Offset #1",yawoffset);
UI.SetValue("Misc", "JAVASCRIPT", "Script Items","JITTER Offset #1",jitteroffset);
//UI.SetValue("Misc", "JAVASCRIPT", "Script Items","YAW Offset #2",yawoffset);
//UI.SetValue("Misc", "JAVASCRIPT", "Script Items","JITTER Offset #2",jitteroffset);
//UI.SetValue("Misc", "JAVASCRIPT", "Script Items","YAW Offset #3",yawoffset);
//UI.SetValue("Misc", "JAVASCRIPT", "Script Items","JITTER Offset #3",jitteroffset);
//UI.SetValue("Misc", "JAVASCRIPT", "Script Items","SWITCH delay",de);
//Global.RegisterCallback("Draw", "main")
Global.RegisterCallback("Draw", "lagsyncmain")

/////////////////////////////////////////////////////////////////////////////////////////
// AntiBrute - By ERRORNAME (onetap forum name wntjq69)                                //
// Public Version - feel free to paste anything from this, just remember to credit me. //
/////////////////////////////////////////////////////////////////////////////////////////
// Credits:                                                                            //
// Valve - many shits from mathlib                                                     //
// https://github.com/ValveSoftware/source-sdk-2013/tree/master/sp/src/public/mathlib  //
/////////////////////////////////////////////////////////////////////////////////////////

UI.AddDropdown("Anti Bruteforce", ["Off", "On Hit", "On Shot"]);
function GetScriptOption(name)
{
    var Value = UI.GetValue("Misc", "JAVASCRIPT", "Script Items", name);
    return Value;
}

function radian(degree)
{
    return degree * Math.PI / 180.0;
}

function ExtendVector(vector, angle, extension)
{
    var radianAngle = radian(angle);
    return [extension * Math.cos(radianAngle) + vector[0], extension * Math.sin(radianAngle) + vector[1], vector[2]];
}

function VectorAdd(a, b)
{
    return [a[0] + b[0], a[1] + b[1], a[2] + b[2]];
}

function VectorSubtract(a, b)
{
    return [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
}

function VectorMultiply(a, b)
{
    return [a[0] * b[0], a[1] * b[1], a[2] * b[2]];
}

function VectorLength(x, y, z)
{
    return Math.sqrt(x * x + y * y + z * z);
}

function VectorNormalize(vec)
{
    var length = VectorLength(vec[0], vec[1], vec[2]);
    return [vec[0] / length, vec[1] / length, vec[2] / length];
}

function VectorDot(a, b)
{
    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}

function VectorDistance(a, b)
{
    return VectorLength(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
}

function ClosestPointOnRay(target, rayStart, rayEnd)
{
    var to = VectorSubtract(target, rayStart);
    var dir = VectorSubtract(rayEnd, rayStart);
    var length = VectorLength(dir[0], dir[1], dir[2]);
    dir = VectorNormalize(dir);

    var rangeAlong = VectorDot(dir, to);
    if (rangeAlong < 0.0)
    {
        return rayStart;
    }
    if (rangeAlong > length)
    {
        return rayEnd;
    }
    return VectorAdd(rayStart, VectorMultiply(dir, [rangeAlong, rangeAlong, rangeAlong]));
}

function Flip()
{
    UI.ToggleHotkey("Anti-Aim", "Fake angles", "Inverter");
}

var lastHitTime = 0.0;
var lastImpactTimes =
[
    0.0
];
var lastImpacts =
[
    [0.0, 0.0, 0.0]
];

function OnHurt()
{
    if (GetScriptOption("Anti Bruteforce") == 0) return;
    if (Entity.GetEntityFromUserID(Event.GetInt("userid")) !== Entity.GetLocalPlayer()) return;
    var hitbox = Event.GetInt('hitgroup');

    if (hitbox == 1 || hitbox == 6 || hitbox == 7)  //head, both toe
    {
        var curtime = Global.Curtime();
        if (Math.abs(lastHitTime - curtime) > 0.5)   //0.2s backtrack + 0.2 extand + 0.1 extra
        {
            lastHitTime = curtime;
            Flip();
        }
    }
}

function OnBulletImpact()
{
    if (GetScriptOption("Anti Bruteforce") !== 2) return;

    var curtime = Global.Curtime();
    if (Math.abs(lastHitTime - curtime) < 0.5) return;

    var entity = Entity.GetEntityFromUserID(Event.GetInt("userid"));
    var impact = [Event.GetFloat("x"), Event.GetFloat("y"), Event.GetFloat("z"), curtime];
    var source;
    if (Entity.IsValid(entity) && Entity.IsEnemy(entity))
    {
        if (!Entity.IsDormant(entity))
        {
            source = Entity.GetEyePosition(entity);
        }
        else if (Math.abs(lastImpactTimes[entity] - curtime) < 0.1)
        {
            source = lastImpacts[entity];
        }
        else
        {
            lastImpacts[entity] = impact;
            lastImpactTimes[entity] = curtime;
            return;
        }
        var local = Entity.GetLocalPlayer();
        var localEye = Entity.GetEyePosition(local);
        var localOrigin = Entity.GetProp(local, "CBaseEntity", "m_vecOrigin");
        var localBody = VectorMultiply(VectorAdd(localEye, localOrigin), [0.5, 0.5, 0.5]);

        var bodyVec = ClosestPointOnRay(localBody, source, impact);
        var bodyDist = VectorDistance(localBody, bodyVec);
        
        if (bodyDist < 128.0)       //he clearly shot at us!
        {
            var realAngle = Local.GetRealYaw();
            var fakeAngle = Local.GetFakeYaw();

            var headVec = ClosestPointOnRay(localEye, source, impact);
            var headDist = VectorDistance(localEye, headVec);
            var feetVec = ClosestPointOnRay(localOrigin, source, impact);
            var feetDist = VectorDistance(localOrigin, feetVec);

            var closestRayPoint;
            var realPos;
            var fakePos;

            if (bodyDist < headDist && bodyDist < feetDist)     //that's a pelvis
            {                                                   //pelvis direction = goalfeetyaw + 180       
                closestRayPoint = bodyVec;
                realPos = ExtendVector(bodyVec, realAngle + 180.0, 10.0);
                fakePos = ExtendVector(bodyVec, fakeAngle + 180.0, 10.0);
            }
            else if (feetDist < headDist)                       //ow my toe
            {                                                   //toe direction = goalfeetyaw -30 +- 90
                closestRayPoint = feetVec;
                var realPos1 = ExtendVector(bodyVec, realAngle - 30.0 + 90.0, 10.0);
                var realPos2 = ExtendVector(bodyVec, realAngle - 30.0 - 90.0, 10.0);
                var fakePos1 = ExtendVector(bodyVec, fakeAngle - 30.0 + 90.0, 10.0);
                var fakePos2 = ExtendVector(bodyVec, fakeAngle - 30.0 - 90.0, 10.0);
                if (VectorDistance(feetVec, realPos1) < VectorDistance(feetVec, realPos2))
                {
                    realPos = realPos1;
                }
                else
                {
                    realPos = realPos2;
                }
                if (VectorDistance(feetVec, fakePos1) < VectorDistance(feetVec, fakePos2))
                {
                    fakePos = fakePos1;
                }
                else
                {
                    fakePos = fakePos2;
                }
            }
            else                                                //ow my head i feel like i slept for 2 days
            {
                closestRayPoint = headVec;
                realPos = ExtendVector(bodyVec, realAngle, 10.0);
                fakePos = ExtendVector(bodyVec, fakeAngle, 10.0);
            }

            if (VectorDistance(closestRayPoint, fakePos) < VectorDistance(closestRayPoint, realPos))        //they shot at our fake. they will probably not gonna shoot it again.
            {
                lastHitTime = curtime;
                Flip();
            }
        }

        lastImpacts[entity] = impact;
        lastImpactTimes[entity] = curtime;
    }
}

Cheat.RegisterCallback("player_hurt", "OnHurt");
Cheat.RegisterCallback("bullet_impact", "OnBulletImpact");

UI.AddLabel("")
UI.AddLabel("----[MISC]----")
UI.AddLabel("")
const hotkey = UI.AddHotkey('Auto-Smoke');
const actions = [
    [function() {Cheat.ExecuteCommand('use weapon_smokegrenade')}, 50],
    [function() {Cheat.ExecuteCommand('+attack2')}, 10],
    [function() {angles = Local.GetViewAngles(); Local.SetViewAngles([90, angles[1], angles[2]])}, 0],
    [function() {Cheat.ExecuteCommand('-attack2')}, 7],
    [function() {Local.SetViewAngles(angles)}, 0],
    [function() {Cheat.ExecuteCommand('slot3')}, 0],
    [function() {Cheat.ExecuteCommand('slot2')}, 0],
    [function() {Cheat.ExecuteCommand('slot1')}, 0]
];
const next = 0, angles = [], current = -1;

function on_tick() {
    if (current == -1 || Globals.Tickcount() <= next) return;
    actions[current][0]();
    next = Globals.Tickcount() + actions[current][1] * (Globals.Tickrate()/64);
    if (++current == actions.length) {
        next = 0;
        current = -1;
    }
} Cheat.RegisterCallback('CreateMove', 'on_tick');

function molotov_detonated() {
    if (!UI.IsHotkeyActive.apply(this, hotkey) || !Entity.IsAlive(Entity.GetLocalPlayer())) return;
    if (~Entity.GetTeammates().indexOf(Entity.GetEntityFromUserID(Event.GetInt('userid'))) && !Entity.IsLocalPlayer(Entity.GetEntityFromUserID(Event.GetInt('userid')))) return;
    const player_pos = Entity.GetRenderOrigin(Entity.GetLocalPlayer());
    const magnitude = Math.sqrt((Event.GetFloat('x') - player_pos[0]) ** 2 + (Event.GetFloat('y') - player_pos[1]) ** 2);
    if (magnitude <= 175 && Math.abs(Event.GetFloat('z') - player_pos[2]) <= 300) current = 0;
} Cheat.RegisterCallback('molotov_detonate', 'molotov_detonated');

function on_draw() {
    Render.String(0, 500, 0, 'Auto-Smoke', [0, 255, 0, UI.IsHotkeyActive.apply(this, hotkey) ? 255 : 0], 16)
} Cheat.RegisterCallback('Draw', 'on_draw');

UI.AddLabel("")

UI.AddCheckbox( "[HMR] Hit/Miss Ratio" );
UI.AddCheckbox( "[HMR] Reset on round start" );

var x = 30, y = 420;

var gun_fired = false;
var font_size = 4;


var other_weapons =
[
    "knife",
    "knife_t",
    "knife_karambit",
    "knife_m9_bayonet",
    "knife_survival_bowie",
    "knife_butterfly",
    "knife_flip",
    "knife_push",
    "knife_tactical",
    "knife_falchion",
    "knife_gut",
    "knife_ursus",
    "knife_gypsy_jackknife",
    "knife_stiletto",
    "knife_widowmaker",
    "knife_css",
    "knife_cord",
    "knife_canis",
    "knife_outdoor",
    "knife_skeleton",
    "bayonet",
    "hegrenade",
    "smokegrenade",
    "molotov",
    "incgrenade",
    "flashbang",
    "decoy",
    "taser"
];

var shots =
{
    fired: 0,
    hit: 0,
    missed: 0,
    hit_chance: 0,
    miss_chance: 0
};

function is_gun(weapon_name) {
  
    for(var i = 0; i < other_weapons.length; i++) {
      
        if(weapon_name == "weapon_" + other_weapons[i]) {

            return false;

        }

    }

    return true;

}

function weapon_fire() {
    var player_id = Event.GetInt("userid");
    var player_weapon = Event.GetString("weapon");

    if(Entity.IsLocalPlayer(Entity.GetEntityFromUserID(player_id)) && is_gun(player_weapon)) {

        shots.fired = shots.fired + 1;
        gun_fired = true;

    }
}

function player_hurt() {
    var attacker_id = Event.GetInt("attacker");
    var attacker_weapon = Event.GetString("weapon");

    if(Entity.IsLocalPlayer(Entity.GetEntityFromUserID(attacker_id)) && is_gun(attacker_weapon) && gun_fired) {

        shots.hit = shots.hit + 1;
        gun_fired = false;

    }
}

function round_prestart() {
    if( UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "[HMR] Reset on round start") ) {
        for (var key in shots){
            shots[key] = 0;
        }
    }
}

function main() {

    if(Global.GetMapName() == "" || !UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "[HMR] Hit/Miss Ratio"))
        return;
  
    shots.missed = shots.fired - shots.hit;
    shots.hit_chance = ( (shots.hit / shots.fired) * 100 );
    shots.miss_chance = ( (shots.missed / shots.fired) * 100 );
  
    text_size = Render.TextSize("total: " + shots.fired, font_size);

    Render.String(x, y, 0, "total: " + shots.fired, [255, 255, 255, 255], font_size);

    Render.String(x, y + (text_size[1]-12), 0, "hit: " + shots.hit, [30, 190, 40, 255], font_size);

    Render.String(x, y + (text_size[1]-12)*2, 0, "miss: " + shots.missed, [200, 60, 40, 255], font_size);

    if(shots.fired > 0) {

        Render.String(x, y + (text_size[1]-12)*3, 0, shots.hit + " / " + shots.fired + " = " + Math.round(shots.hit_chance) + "%", [30, 95, 190, 255], font_size);

        Render.String(x, y + (text_size[1]-12)*4, 0, shots.missed + " / " + shots.fired + " = " + Math.round(shots.miss_chance) + "%", [25,175,115, 255], font_size);

    }

}

Global.RegisterCallback("weapon_fire", "weapon_fire");
Global.RegisterCallback("player_hurt", "player_hurt");
Global.RegisterCallback("round_prestart", "round_prestart");

Global.RegisterCallback("Draw", "main");

UI.AddLabel("")

var run = false;
var estimate = 0;
var firstBuy = 0;
var alias = [
    ["awp"],
    ["ssg08"],
    ["scar20", "g3sg1"]
]

function roundEnded() {
    run = true;
    estimate = Globals.Curtime()+Convar.GetInt("mp_round_restart_delay");
    firstBuy = 0;
}

function purchase(index) {
    alias[index].forEach(function(v) { Cheat.ExecuteCommand("buy "+v); })
    run = false;
}

function onDraw() {
    run && Globals.Curtime()+(Local.Latency()/1000) >= estimate && purchase(UI.GetValue.apply(this, dropdown));
}

function purchased() {
    if (firstBuy == 0) firstBuy = Globals.Curtime()-estimate;
    if (!Entity.GetEntityFromUserID(Event.GetInt("userid")) || firstBuy == -1) return;

    Cheat.Print("The first item of the round was purchased at " + firstBuy + "s, you purchased at " + (Globals.Curtime()-estimate) + "s.\n");
    firstBuy = -1;
}

var dropdown = UI.AddDropdown("Fastest Autobuy", ["AWP", "Scout", "Auto"]);

Cheat.RegisterCallback("round_end", "roundEnded");
Cheat.RegisterCallback("Draw", "onDraw");
Cheat.RegisterCallback("item_purchase", "purchased");

Cheat.RegisterCallback("CreateMove", "cMove");
UI.AddHotkey("Slow-walk:");

UI.AddSliderInt("Speed:", 0, 135);

UI.AddCheckbox("Individual speeds:", 0, 135);

UI.AddSliderInt("Forward Speed:", 0, 135);
UI.AddSliderInt("Side Speed:", 0, 135);
UI.AddSliderInt("Back Speed:", 0, 135);

UI.AddLabel("")

function getVal(valName) {return UI.GetValue("Misc", "JAVASCRIPT", "Script items", valName);}

function cMove() {
    //forward, side, up.
    if (!UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Slow-walk:")) return;

    speed = getVal("Speed:");

    fSpeed = speed;
    bSpeed = speed;
    sSpeed = speed;

    if (getVal("Individual speeds:")) {
        fSpeed = getVal("Forward Speed:");
        bSpeed = getVal("Back Speed:");
        sSpeed = getVal("Side Speed:");
    }

    dir = [0, 0, 0];

    if (Input.IsKeyPressed(0x57)) {
        //'W' AKA Forward
        dir[0] += fSpeed;
    }
    if (Input.IsKeyPressed(0x44)) {
        //'D' AKA Right
        dir[1] += sSpeed;
    }
    if (Input.IsKeyPressed(0x41)) {
        //'A' AKA Left
        dir[1] -= sSpeed;
    }
    if (Input.IsKeyPressed(0x53)) {
        //'S' AKA Back
        dir[0] -= bSpeed;
    }

    UserCMD.SetMovement(dir);
}


UI.AddLabel("")
UI.AddLabel("----[Arrow]----")


var screen_size = Global.GetScreenSize();
var isLeftActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Left Hotkey" );
UI.AddColorPicker("Arrows color");
UI.AddColorPicker("Selected arrow color");
UI.AddColorPicker("Text color");
var isRightActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Right Hotkey" );
var isBackwardsActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Backwards Hotkey" );
var isHideRealActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "HideReal Hotkey" );
var isInverted;
var drawLeft = 1; drawHideReal = 1;
var drawRight = 0, drawBack = 0;
       
function drawString()
{
    arrowscp = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Arrows color");
    textcp = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Text color");
    selectedcp = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Selected arrow color");
    arrows_red = arrowscp[0];
    arrows_green = arrowscp[1];
    arrows_blue = arrowscp[2];
    arrows_alpha = arrowscp[3];
    text_red = textcp[0];
    text_green = textcp[1];
    text_blue = textcp[2];
    text_alpha = textcp[3];
    selected_red = selectedcp[0];
    selected_green = selectedcp[1];
    selected_blue = selectedcp[2];
    selected_alpha = selectedcp[3];
    isHideshots = UI.IsHotkeyActive("Rage", "Exploits", "Hide shots");
    isSafepoint = UI.IsHotkeyActive("Rage", "General", "Safe point override");
    isDoubletap = UI.IsHotkeyActive("Rage", "Exploits", "Doubletap");
    isInverted = UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter");
    Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +50, 0, "DESYNC", [ text_red, text_green, text_blue, text_alpha ], 3 );

   
    if(drawLeft)
    {
        Render.String(screen_size[0] /2 -50, screen_size[1] /2 -30, 1,  "<", [ selected_red, selected_green, selected_blue, selected_alpha ], 4 );
        Render.String(screen_size[0] /2 +50, screen_size[1] /2 -30, 1,  ">", [ arrows_red, arrows_green, arrows_blue, arrows_alpha ], 4 );
        Render.String(screen_size[0] /2, screen_size[1] /2 +25, 1,  "v", [ arrows_red, arrows_green, arrows_blue, arrows_alpha ], 4 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +58, 0, isInverted ? "LEFT" : "RIGHT", [ text_red, text_green, text_blue, text_alpha ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +66, 0, isHideshots ? "HIDE" : "HIDE", isHideshots ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +74, 0, isDoubletap ? "DT" : "DT", isDoubletap ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +82, 0, isSafepoint ? "SP" : "SP", isSafepoint ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
    }
    else if(drawRight)
    {  
        Render.String(screen_size[0] /2 -50, screen_size[1] /2 -30, 1,  "<", [ arrows_red, arrows_green, arrows_blue, arrows_alpha ], 4 );
        Render.String(screen_size[0] /2 +50, screen_size[1] /2 -30, 1,  ">", [ selected_red, selected_green, selected_blue, selected_alpha ], 4 );
        Render.String(screen_size[0] /2, screen_size[1] /2 +25, 1,  "v", [ arrows_red, arrows_green, arrows_blue, arrows_alpha ], 4 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +58, 0, isInverted ? "LEFT" : "RIGHT", [ text_red, text_green, text_blue, text_alpha ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +66, 0, isHideshots ? "HIDE" : "HIDE", isHideshots ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +74, 0, isDoubletap ? "DT" : "DT", isDoubletap ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +82, 0, isSafepoint ? "SP" : "SP", isSafepoint ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
    }
    else if(drawBack)
    {
        Render.String(screen_size[0] /2 -50, screen_size[1] /2 -30, 1,  "<", [ arrows_red, arrows_green, arrows_blue, arrows_alpha ], 4 );
        Render.String(screen_size[0] /2 +50, screen_size[1] /2 -30, 1,  ">", [ arrows_red, arrows_green, arrows_blue, arrows_alpha ], 4 );
        Render.String(screen_size[0] /2, screen_size[1] /2 +25, 1,  "v", [ selected_red, selected_green, selected_blue, selected_alpha ], 4 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +58, 0, isInverted ? "LEFT" : "RIGHT", [ text_red, text_green, text_blue, text_alpha ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +66, 0, isHideshots ? "HIDE" : "HIDE", isHideshots ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +74, 0, isDoubletap ? "DT" : "DT", isDoubletap ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +82, 0, isSafepoint ? "SP" : "SP", isSafepoint ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
   
    }
    else if(drawHideReal)
    {
        Render.String(screen_size[0] /2 -50, screen_size[1] /2 -20, 1,  "<", [ 255, 255, 255, 255 ], 4 );
        Render.String(screen_size[0] /2 +50, screen_size[1] /2 -20, 1,  ">", [ 255, 255, 255, 255 ], 4 );
        Render.String(screen_size[0] /2, screen_size[1] /2 +25, 1,  "v", [ 255, 255, 255, 255 ], 4 );
        Render.String(screen_size[0] /2 + 14 , screen_size[1] /2 +58, 0, isHideshots ? "HIDE" : "HIDE", isHideshots ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +66, 0, isDoubletap ? "DT" : "DT", isDoubletap ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
        Render.String(screen_size[0] /2 + 14, screen_size[1] /2 +74, 0, isSafepoint ? "SP" : "SP", isSafepoint ? [ 124, 195, 13, 255 ] : [ 255, 0, 0, 255 ],3 );
    }
}

function onCreateMove()
{
    isLeftActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Left Hotkey" );
    isRightActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Right Hotkey" );
    isBackwardsActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Backwards Hotkey" );
    isHideRealActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "HideReal Hotkey" );
   
    if(isLeftActive)
    {  
        drawLeft = 1;
        drawBack = 0;
        drawRight = 0;
        UI.SetValue( "Anti-Aim", "Rage Anti-Aim", "Yaw offset", -90 );
        UI.SetValue( "Anti-Aim", "Fake Angles", "Hide real angle", false);
    }
    else if(isRightActive)
    {  
        drawLeft = 0;
        drawBack = 0;
        drawRight = 1;
        UI.SetValue( "Anti-Aim", "Rage Anti-Aim", "Yaw offset", 90 );
        UI.SetValue( "Anti-Aim", "Fake Angles", "Hide real angle", false);
       
    }
    else if(isBackwardsActive)
    {  
        drawLeft = 0;
        drawBack = 1;
        drawRight = 0;
        UI.SetValue( "Anti-Aim", "Rage Anti-Aim", "Yaw offset", 0 );
        UI.SetValue( "Anti-Aim", "Fake Angles", "Hide real angle", false);
    }
    else if(isHideRealActive)
    {
        drawLeft = 0;
        drawBack = 0;
        drawRight = 0;
        UI.SetValue( "Anti-Aim", "Rage Anti-Aim", "Yaw offset", 0 );
        UI.SetValue("Anti-Aim", "Fake Angles", "Hide real angle", true);
    }
}

function Main()
{
    UI.AddHotkey( "Left Hotkey" );
    UI.AddHotkey( "Right Hotkey" );
    UI.AddHotkey( "Backwards Hotkey" );
    UI.AddHotkey( "HideReal Hotkey" );
   
    //  callbacks
    Global.RegisterCallback("Draw", "drawString")
    Global.RegisterCallback("CreateMove", "onCreateMove")
}
Main();