
UI.AddLabel("====Ma$terHook.js====");

UI.AddLabel("    Rage    ");

UI.AddCheckbox("Rage Bot fix");



var target = 1
function cm()
{
    target = Ragebot.GetTarget()
    if (GetVelocity(target) <= 66)
    {
        Ragebot.ForceHitboxSafety(2)
    }
}
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", "cm")



var target = 1
function cm()
{
    target = Ragebot.GetTarget()
    if (GetVelocity(target) <= 100)
    {
        Ragebot.ForceTargetMinimumDamage(target, 51)
    }
}
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", "cm")



var target = 1
function cm()
{
    target = Ragebot.GetTarget()
    if (GetVelocity(target) <= 64)
    {
        Ragebot.ForceTargetHitchance(target, 54)
    }
}
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", "cm")

var target = 1
function cm()
{
    target = Ragebot.GetTarget()
    if (Entity.GetName(target) == "edeen")
    {
        Ragebot.ForceTargetSafety(target)
    }
}
Cheat.RegisterCallback("CreateMove", "cm")



var target = 1
function cm()
{
    target = Ragebot.GetTarget()
    if (Entity.GetName(target) == "edeen")
    {
        Ragebot.ForceTargetSafety(target)
    }
}
Cheat.RegisterCallback("CreateMove", "cm")

UI.AddMultiDropdown("Force safepoint on limbs", ["Legs", "Feet"]);

function on_move()
{
    const safepoint_selection = UI.GetValue("Misc", "Force safepoint on limbs");
    if(safepoint_selection & (1 << 0)) //Webster, you don't need a library to use multidropdowns, l0l
    {
        Ragebot.ForceHitboxSafety(7);
        Ragebot.ForceHitboxSafety(8);
        Ragebot.ForceHitboxSafety(9);
        Ragebot.ForceHitboxSafety(10);
    }
    if(safepoint_selection & (1 << 1))
    {
        Ragebot.ForceHitboxSafety(11);
        Ragebot.ForceHitboxSafety(12);
    }
}

Cheat.RegisterCallback("CreateMove", "on_move");

UI.AddCheckbox("JumpScout");

//Jumpscout
var hitchanceBak = UI.GetValue("Rage", "SCOUT", "Accuracy", "Hitchance");
var block_set2 = false;
var scoutInAir = 53;
function jumpscout(){
	if(!checkbox_states["JumpScout"]) return;
	if(getWeaponName() !== "ssg 08"){
		if(UI.GetValue("Rage", "SCOUT", "Accuracy", "Hitchance") !== scoutInAir){
			hitchanceBak = UI.GetValue("Rage", "SCOUT", "Accuracy", "Hitchance");
		}
		if(block_set2) return;
		UI.SetValue("Rage", "SCOUT", "Accuracy", "Hitchance", hitchanceBak);
		block_set2 = true;
		return;
	}

	if (isInAir()){
		block_set2 = false;
		UI.SetValue("Rage", "SCOUT", "Accuracy", "Hitchance", scoutInAir);
	}
    else{
		if(UI.GetValue("Rage", "SCOUT", "Accuracy", "Hitchance") !== scoutInAir){
			hitchanceBak = UI.GetValue("Rage", "SCOUT", "Accuracy", "Hitchance");
		}
		if(block_set2) return;
		UI.SetValue("Rage", "SCOUT", "Accuracy", "Hitchance", hitchanceBak);
		block_set2 = true;
    }
}
  


UI.AddCheckbox("Safe AWP");

//Safe AWP
var safePbak = false;
function safeAWP(){
	if(!checkbox_states["Safe_AWP"]) return;
    weapon = getWeaponName();

    if(weapon == "awp"){
        forceSafePoint = UI.IsHotkeyActive('Rage', 'GENERAL', 'General', 'Force safe point');
        if (!forceSafePoint){
            UI.ToggleHotkey('Rage', 'GENERAL', 'General', 'Force safe point');
            safePbak = true;
        }
    }
    else if (safePbak){
        UI.ToggleHotkey('Rage', 'GENERAL', 'General', 'Force safe point');
        safePbak = false;
    }
}


