
user_of_hardtech = Cheat.GetUsername();

Cheat.PrintColor([130, 130, 255, 255], " " + "\n")
Cheat.PrintColor([130, 130, 255, 255], "[Hard Tech] Welcome To Hard Tech" + "\n")
Cheat.PrintColor([130, 130, 255, 255], "[Hard Tech] Logged in as: " + user_of_hardtech + "\n")
Cheat.PrintColor([130, 130, 255, 255], " " + "\n")
menu_setup = function () {
    const N = UI.GetValue("Misc","JAVASCRIPT", "Menu"),
        l = N == 0x0,
        i = N == 0x1,
        x = N == 0x2,
        z = N == 0x3,
        s = N == 0x4;
    UI.SetEnabled("Hard Tech", l), UI.SetEnabled("discord: CroUzer ;w;#6463", l)
    UI.SetEnabled("Safety if lethal", i), UI.SetEnabled("Safepoint on slowwalk", i), UI.SetEnabled("Hitchance Scout", i), UI.SetEnabled("DT Peek Helper [SSG08 & AWP]", i), UI.SetEnabled("Double-Tap Recharge", i), UI.SetEnabled("Safe point on limps", i), UI.SetEnabled("Ping Spike", i)
    UI.SetEnabled("At Targets on Air", x), UI.SetEnabled("Legit AA", x), UI.SetEnabled("Fake-Lag", x), UI.SetEnabled("Freestanding on autopeek", x), UI.SetEnabled("Low Delta", x), UI.SetEnabled("Leg fucker", x)
    UI.SetEnabled("Viewmodel on scope", z)
    UI.SetEnabled("Autostrafe fix", s), UI.SetEnabled("Buy logs", s), UI.SetEnabled("Clantag", s), UI.SetEnabled("FPS Boost", s)
},

//information about sctipt
UI.AddDropdown("Menu",["Information", "Rage", "Anti-Aim", "Vusials", "Misc"])

UI.AddLabel("Hard Tech");
UI.AddLabel("discord: CroUzer ;w;#6463");
UI.AddCheckbox("DT Peek Helper [SSG08 & AWP]");
UI.AddCheckbox("Safepoint on slowwalk");
UI.AddCheckbox("Safe point on limps");
UI.AddCheckbox("Safety if lethal");
UI.AddCheckbox("Double-Tap Recharge")
UI.AddHotkey("Ping Spike");
UI.AddSliderInt("Hitchance Scout", 1, 100);


UI.AddCheckbox("Freestanding on autopeek");
UI.AddCheckbox("At Targets on Air");
UI.AddCheckbox("Leg fucker")
UI.AddCheckbox("Low Delta");
UI.AddCheckbox("Fake-Lag");
UI.AddHotkey('Legit AA');

UI.AddCheckbox("Autostrafe fix")
UI.AddCheckbox('FPS Boost');
UI.AddCheckbox("Buy logs");
UI.AddCheckbox("Clantag");

UI.AddCheckbox("Viewmodel on scope");
Cheat.RegisterCallback("Draw", "menu_setup");
//RAGE

//recharge
//Weapon fire event
function EVENT_WEAPON_FIRE()
{
    iShotsFired = Event.GetInt("userid"); iShotsFired_index = Entity.GetEntityFromUserID(iShotsFired);
 
    if(Entity.GetLocalPlayer() == iShotsFired_index)
    {
            //Released only once
            if(shotsfired == 0)
            {
                time = Globals.Curtime();
                delay = time+0.3;
                fillbar = 0;
            }              
    }    
}

function can_shift_shot(ticks_to_shift) {
    var me = Entity.GetLocalPlayer();
    var wpn = Entity.GetWeapon(me);

    if (me == null || wpn == null)
        return false;

    var tickbase = Entity.GetProp(me, "CCSPlayer", "m_nTickBase");
    var curtime = Globals.TickInterval() * (tickbase-ticks_to_shift)

    if (curtime < Entity.GetProp(me, "CCSPlayer", "m_flNextAttack"))
        return false;

    if (curtime < Entity.GetProp(wpn, "CBaseCombatWeapon", "m_flNextPrimaryAttack"))
        return false;

    return true;
}

function _TBC_CREATE_MOVE() {
    var is_charged = Exploit.GetCharge()

    Exploit[(is_charged != 1 ? "Enable" : "Disable") + "Recharge"]()

    if (can_shift_shot(14) && is_charged != 1) {
        Exploit.DisableRecharge();
        Exploit.Recharge()
    }

    Exploit.OverrideTolerance(0);
    Exploit.OverrideShift(14);
}

function _TBC_UNLOAD() {
    Exploit.EnableRecharge();
}
function Main()
{
    Global.RegisterCallback("CreateMove", "_TBC_CREATE_MOVE");
    Global.RegisterCallback("Unload", "_TBC_UNLOAD");
    Global.RegisterCallback("weapon_fire", "EVENT_WEAPON_FIRE");

}

Main();
//FAKE LAG
/** @type {number} */
var cache = 0;
/** @type {number} */
var frame = 0;
/**
 * @return {undefined}
 */
function fluctates() {
  if (UI.GetValue("Script items", "Fake-Lag")) {
    frame++;
    if (frame == 30) {
      /** @type {number} */
      frame = 1;
    }
    if (frame >= 15 && frame <= 30) {
      UI.SetValue("Anti-Aim", "Fake-Lag", "Enabled", true);
    } else {
      UI.SetValue("Anti-Aim", "Fake-Lag", "Enabled", false);
    }
  }
}
Global.RegisterCallback("CreateMove", "fluctates");
//legit aa
function legitaa() {
    UI.SetValue("Misc", "PERFORMANCE & INFORMATION", "Restrictions", "0");
    if (UI.IsHotkeyActive('Misc', 'JAVASCRIPT', 'Script items', 'Legit AA')) {
        UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", 180);
        UI.SetValue("Anti-Aim", "Extra", "Pitch", 0);
        UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets", 0);
    }
    else {
        UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", 0);
        UI.SetValue("Anti-Aim", "Extra", "Pitch", 1);
        UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets", 0);
    }
}
Cheat.RegisterCallback("Draw", "legitaa")
//targets


//FRESTAND AP
function autopeek()
{
    if(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Freestanding on autopeek"))
    {
        if(UI.IsHotkeyActive("Misc", "GENERAL", "Movement", "Auto peek"))
        {
            UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Auto direction", true);
        }
        else
        {
            UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Auto direction", false);
        }
    }
}
Cheat.RegisterCallback("CreateMove", "autopeek");
//low delta
function Safe_Head()
{
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Low Delta") && UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk"))
    {
		AntiAim.SetOverride(1);
		AntiAim.SetFakeOffset(7);
		AntiAim.SetRealOffset(-14);
		AntiAim.SetLBYOffset(0);
    }
    else
    {
        AntiAim.SetOverride(0);
    }
}
Cheat.RegisterCallback("CreateMove", "Safe_Head");
//bhop
function d(){
    if(UI.GetValue("Autostrafe fix")){
        UI.SetValue("Misc", "GENERAL", "Movement", "Turn speed", 266)
        UI.SetValue("Misc", "GENERAL", "Movement", "Auto strafe", 3)
    }
}

function FixBunnyhop() {
    if (Convar.GetFloat("sv_airaccelerate") != 106) {
        Convar.SetFloat("sv_airaccelerate", 106);
    }
}

Cheat.RegisterCallback("CreateMove", "d");
Cheat.RegisterCallback("CreateMove", "FixBunnyhop");
//buy logs
function BuyLogs(){
    Global.Print('k')
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "Buy logs")) {
        var ent = Entity.GetEntityFromUserID(Event.GetInt('userid'))
        var team = Event.GetInt('team')
        if (team != Entity.GetProp(Entity.GetLocalPlayer(), "CBaseEntity", "m_iTeamNum")) {
            var item = Event.GetString('weapon')
            item = item.replace("weapon_", "")
            item = item.replace("item_", "")
            item = item.replace("assaultsuit", "kevlar + helmet")
            item = item.replace("incgrenade", "molotov")
            if (item != "unknown") {
                var name = Entity.GetName(ent)
                Global.PrintChat(" \x02[\x07CroUzer Cord\x02] \x04" + name + " \x01bought \x04" + item + " \n");
            }
        }
    }
}
Global.RegisterCallback("item_purchase", "BuyLogs");

//safe
function safepoint() {
 if (UI.GetValue("Script items", "Safe point on limps")) {
//var
localplayer_index = Entity.GetLocalPlayer( );
localplayer_weapon = Entity.GetWeapon(localplayer_index);
weapon_name = Entity.GetName(localplayer_weapon);

    if (GetVelocity(localplayer_index) <= 100 && weapon_name  == "awp" || weapon_name  == "scar 20" || weapon_name  == "g3sg1" || weapon_name  == "r8 revolver" || weapon_name  == "desert eagle" ) {
       Ragebot.ForceHitboxSafety(0);
       Ragebot.ForceHitboxSafety(9);
       Ragebot.ForceHitboxSafety(10);
       Ragebot.ForceHitboxSafety(11);
       Ragebot.ForceHitboxSafety(12);
	}	 
  }
}

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

Cheat.RegisterCallback("CreateMove", "safepoint");
//Ping Spike
function ping() {
	if (UI.IsHotkeyActive( "Script items", "Ping Spike" )) {
		UI.SetValue( "Misc", "GENERAL", "Miscellaneous", "Extended backtracking", true);
	} else {
		UI.SetValue( "Misc", "GENERAL", "Miscellaneous", "Extended backtracking", false);
	}
}
Cheat.RegisterCallback("Draw", "ping");
//min dmg



//leg fucker
/** @type {number} */
var old_tick_count = 0;
/**
 * @return {undefined}
 */
function legfucker() {
  if (UI.GetValue("Script items", "Leg fucker") && Globals.Tickcount() - old_tick_count > 7) {
    if (UI.GetValue("Misc", "GENERAL", "Movement", "Slide walk")) {
      UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 0);
    } else {
      UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 1);
    }
    old_tick_count = Globals.Tickcount();
  }
}
Cheat.RegisterCallback("CreateMove", "legfucker");


//Viewmodel on scope
function draw() {
  if (UI.GetValue("Script items", "Viewmodel on scope")) {
    var activeEntityKey = Entity.GetLocalPlayer();
    var cu = UI.GetValue("Script Items", "Viewmodel on scope");
    if (!Entity.IsAlive(activeEntityKey) || !World.GetServerString()) {
      Convar.SetInt("fov_cs_debug", 0);
      return;
    }
    scoped = Entity.GetProp(activeEntityKey, "CCSPlayer", "m_bIsScoped");
    if (cu == 0) {
      Convar.SetInt("fov_cs_debug", 0);
    } else {
      if (scoped) {
        if (!UI.IsHotkeyActive("Visual", "WORLD", "View", "Thirdperson")) {
          Cheat.ExecuteCommand("fov_cs_debug 90");
          UI.SetValue("Visual", "WORLD", "View", "FOV while scoped", 0);
        }
      } else {
        Convar.SetInt("fov_cs_debug", 0);
      }
    }
  }
}
Cheat.RegisterCallback("Draw", "draw");
//dt peek helper
var dtpeek_cache = true;
DT_PeekHelper = function(){
	if (!UI.GetValue("Script items", "DT Peek Helper [SSG08 & AWP]")) return;
	weapon_name =  Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))
    doubletap = UI.IsHotkeyActive("Rage", "GENERAL", "Exploit", "Doubletap");
    autopeek = UI.IsHotkeyActive("Misc", "GENERAL", "Movement", "Auto peek");
    active = (doubletap && autopeek);
 
    if (active && (weapon_name == "ssg 08" || weapon_name == "awp")){
    if (dtpeek_cache){
		scout_prefer = UI.GetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point")
		scout_stop = UI.GetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode")
        autodirection_cache = UI.GetValue("Anti-Aim", "Rage Anti-Aim", "Auto direction");
        dtpeek_cache = false;
    } 
	UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point", true)
	UI.SetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode", 8)
    UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Auto direction", active);
    }else if (!dtpeek_cache){
		UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point", scout_prefer)
		UI.SetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode", scout_stop)
        UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Auto direction", autodirection_cache);
        dtpeek_cache = true;
    }
}
 
Cheat.RegisterCallback("Draw", "DT_PeekHelper");
 
/// AWP
var safePBackup = false
 
function safeAWP() {
    SlocalPlayer = Entity.GetLocalPlayer()
	SlocalPlayerWeapon = Entity.GetWeapon(SlocalPlayer)
	SlocalPlayerWeaponName = Entity.GetName(SlocalPlayerWeapon)
 
	if ( UI.GetValue('Misc', 'JAVASCRIPT', 'Script items', 'Safe Points For AWP') && SlocalPlayerWeaponName == 'awp' ) {
		forceSafePoint = UI.IsHotkeyActive('Rage', 'GENERAL', 'General', 'Force safe point')
		if (!forceSafePoint) {
			UI.ToggleHotkey('Rage', 'GENERAL', 'General', 'Force safe point')
			safePBackup = true
		}
	} else if (safePBackup) {
		UI.ToggleHotkey('Rage', 'GENERAL', 'General', 'Force safe point')
		safePBackup = false
	}
}
//at targets
 var targetair = UI.GetValue("At Targets on Air");
var yaw_base_cache = UI.GetValue("Anti-Aim", "Rage Anti-Aim", "At targets");
 var target_chache = UI.SetValue("Anti-Aim", "Rage Anti-Aim", "At targets");
//Targets on Air
function GetVelocity(index) {
    var velocity = Entity.GetProp(index, "CBasePlayer", "m_vecVelocity[0]");
    return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
}

function airtar() {
    local = Entity.GetLocalPlayer()
    inair = GetVelocity(local)
    if (inair > 250)
    UI.SetValue('Anti-Aim', 'Rage Anti-Aim', 'At targets', true);
    else UI.SetValue('Anti-Aim', 'Rage Anti-Aim', 'At targets', false);
}
Cheat.RegisterCallback("CreateMove", "airtar")
//jump
var oldHitChance = UI.GetValue("Rage", "SCOUT", "Accuracy", "Hitchance");
var isInAir = function(){
if(Global.IsKeyPressed((0x20))){
return true;
}else{
return false;
}
}

function updateValues(){
if(isInAir()){
var Hitchance = UI.GetValue("Script items", "Hitchance Scout");
UI.SetValue("Rage", "SCOUT", "Accuracy", "Hitchance", Hitchance);
}else{
UI.SetValue("Rage", "SCOUT", "Accuracy", "Hitchance", oldHitChance);
}
}

Global.RegisterCallback("CreateMove", "updateValues")
//save point safety
const bodyiflethal = function() {
  var ei = UI.GetValue("Script items", "Safety if lethal");
  var magnifier = Ragebot.GetTarget();
  var $magnifier = enemyhp(magnifier);
  var id = Entity.GetLocalPlayer();
  var i = Entity.GetWeapon(id);
  var $sendIcon = Entity.GetName(i);
  if (ei == true) {
    return;
  }
  if ($sendIcon == "ssg 08") {
    /** @type {number} */
    hp_override = 93;
  }
  if ($sendIcon == "scar 20" || $sendIcon == "g3sg1") {
    /** @type {number} */
    damage_slider = 66;
  }
  if ($sendIcon == "awp") {
    /** @type {number} */
    damage_slider = 91;
  }
  if ($sendIcon == "r8 revolver" || $sendIcon == "desert eagle") {
    /** @type {number} */
    damage_slider = 61;
  }
  if ($sendIcon == "p2000" || $sendIcon == "five seven" || $sendIcon == "p250" || $sendIcon == "usp s" || $sendIcon == "dual berettas" || $sendIcon == "cz75 auto" || $sendIcon == "tec 9" || $sendIcon == "glock 18") {
    /** @type {number} */
    damage_slider = 51;
  }
  if (ei == true) {
    if ($magnifier < hp_override) {
      Ragebot.ForceHitboxSafety(2);
      Ragebot.ForceHitboxSafety(3);
      Ragebot.ForceHitboxSafety(4);
      Ragebot.ForceHitboxSafety(5);
    }
  }
};
Cheat.RegisterCallback("CreateMove", "bodyiflethal");
//save point on slowwalk
function getVelocity(key) {
  if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Safepoint on slowwalk")) {
    return;
  }
  var v = Entity.GetProp(key, "CBasePlayer", "m_vecVelocity[0]");
  return Math.sqrt(v[0] * v[0] + v[1] * v[1]);
}
/**
 * @return {undefined}
 */
function doWork() {
  if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Safepoint on slowwalk")) {
    return;
  }
  var object = Aimbot.GetTarget();
  var v = getVelocity(object);
  if (v < 85) {
    Ragebot.ForceTargetSafety(object);
  }
}
Cheat.RegisterCallback("CreateMove", "doWork");
//clantag
/** @type {number} */
var lasttime = 0;
/**
 * @return {undefined}
 */
function CreateMoves() {
  if (!World.GetServerString()) {
    return;
  }
  var de = UI.GetValue("Script Items", "Clantag");
  /** @type {number} */
  var MINOR_INTERVAL_RATIO = 2;
  /** @type {number} */
  var ts = parseInt(Globals.Curtime() * MINOR_INTERVAL_RATIO);
  if (ts != lasttime) {
    if (de == 0) {
      Local.SetClanTag("");
    }
    if (de == 1) {
      switch(ts % 22) {
        case 0:
          {
            Local.SetClanTag("Hard Tech ");
            break;
          }
        case 1:
          {
            Local.SetClanTag("Hard Tec ");
            break;
          }
        case 2:
          {
            Local.SetClanTag("Hard Te ");
            break;
          }
        case 3:
          {
            Local.SetClanTag("Hard T ");
            break;
          }
        case 4:
          {
            Local.SetClanTag("Hard  ");
            break;
          }
        case 5:
          {
            Local.SetClanTag("Har ");
            break;
          }
        case 6:
          {
            Local.SetClanTag("Ha ");
            break;
          }
        case 7:
          {
            Local.SetClanTag(" H ");
            break;
          }
        case 8:
          {
            Local.SetClanTag("  ");
            break;
          }
        case 9:
          {
            Local.SetClanTag("  ");
            break;
          }
        case 10:
          {
            Local.SetClanTag("H ");
            break;
          }
        case 11:
          {
            Local.SetClanTag("Ha ");
            break;
          }
        case 12:
          {
            Local.SetClanTag("Har ");
            break;
          }
        case 13:
          {
            Local.SetClanTag("Hard ");
            break;
          }
        case 14:
          {
            Local.SetClanTag("Hard T ");
            break;
          }
        case 15:
          {
            Local.SetClanTag("Hard Te");
            break;
          }
        case 16:
          {
            Local.SetClanTag("Hard Tec ");
            break;
          }
        case 17:
          {
            Local.SetClanTag("Hard Tech ");
            break;
          }
      }
    }
  }
  /** @type {number} */
  lasttime = ts;
}
Cheat.RegisterCallback("FrameStageNotify", "CreateMoves");
//FPS BOOST
function fps_boost() {
    if (UI.GetValue('Misc', 'JAVASCRIPT', 'Script Items', 'FPS Boost')) {
        UI.SetValue('Misc', 'GENERAL', 'Misc', 'Force sv_cheats', true);
        UI.SetValue('Misc', 'GENERAL', 'Misc', 'Hidden cvars', true);
        Convar.SetString('r_shadows', '0');
        Convar.SetString('cl_csm_static_prop_shadows', '0');
        Convar.SetString('cl_csm_shadows', '0');
        Convar.SetString('cl_csm_world_shadows', '0');
        Convar.SetString('cl_foot_contact_shadows', '0');
        Convar.SetString('cl_csm_viewmodel_shadows', '0');
        Convar.SetString('cl_csm_rope_shadows', '0');
        Convar.SetString('cl_csm_sprite_shadows', '0');
        Convar.SetString('cl_csm_world_shadows_in_viewmodelcascade', '0');
        Convar.SetString('cl_csm_translucent_shadows', '0');
        Convar.SetString('cl_csm_entity_shadows', '0');
        Convar.SetString('violence_hblood', '0');
        Convar.SetString('r_3dsky', '0');
        Convar.SetString('r_drawdecals', '0');
        Convar.SetString('r_drawrain', '0');
        Convar.SetString('r_drawropes', '0');
        Convar.SetString('r_drawsprites', '0');
        Convar.SetString('fog_enable_water_fog', '0');
        Convar.SetString('@panorama_disable_blur', '1');
        Convar.SetString('dsp_slow_cpu', '1');
        Convar.SetString('cl_disable_ragdolls', '1');
        Convar.SetString('mat_disable_bloom', '1')
    } else {
        Convar.SetString('r_shadows', '1');
        Convar.SetString('cl_csm_static_prop_shadows', '1');
        Convar.SetString('cl_csm_shadows', '1');
        Convar.SetString('cl_csm_world_shadows', '1');
        Convar.SetString('cl_foot_contact_shadows', '1');
        Convar.SetString('cl_csm_viewmodel_shadows', '1');
        Convar.SetString('cl_csm_rope_shadows', '1');
        Convar.SetString('cl_csm_sprite_shadows', '1');
        Convar.SetString('cl_csm_world_shadows_in_viewmodelcascade', '1');
        Convar.SetString('cl_csm_translucent_shadows', '1');
        Convar.SetString('cl_csm_entity_shadows', '1');
        Convar.SetString('violence_hblood', '1');
        Convar.SetString('r_3dsky', '1');
        Convar.SetString('r_drawdecals', '1');
        Convar.SetString('r_drawrain', '1');
        Convar.SetString('r_drawropes', '1');
        Convar.SetString('r_drawsprites', '1');
        Convar.SetString('fog_enable_water_fog', '1');
        Convar.SetString('@panorama_disable_blur', '0');
        Convar.SetString('dsp_slow_cpu', '0');
        Convar.SetString('cl_disable_ragdolls', '0');
        Convar.SetString('mat_disable_bloom', '0')
    }
}