JS-скрипт Better autopeek

make ru hacks great again
Пользователь
Статус
Оффлайн
Регистрация
2 Фев 2019
Сообщения
315
Реакции[?]
91
Поинты[?]
0
1614399274416.png
JavaScript:
UI.AddSubTab(["Misc.","SUBTAB_MGR"], "Better auto peek");
UI.AddHotkey(["Config", "Scripts", "JS Keybinds"], "better autopeek", "better autopeek");

UI.AddCheckbox(["Misc.", "Better auto peek","Better auto peek"],"Override hitchance");
UI.AddSliderInt(["Misc.", "Better auto peek","Better auto peek"], "scout hc", 0, 100);
UI.AddSliderInt(["Misc.", "Better auto peek","Better auto peek"], "awp hc", 0, 100);
UI.AddSliderInt(["Misc.", "Better auto peek","Better auto peek"], "r8 hc", 0, 100);

UI.AddCheckbox(["Misc.", "Better auto peek","Better auto peek"],"Override damage");
UI.AddSliderInt(["Misc.", "Better auto peek","Better auto peek"], "scout dmg", 0, 120);
UI.AddSliderInt(["Misc.", "Better auto peek","Better auto peek"], "awp dmg", 0, 120);
UI.AddSliderInt(["Misc.", "Better auto peek","Better auto peek"], "r8 dmg", 0, 120);

UI.AddCheckbox(["Misc.", "Better auto peek","Better auto peek"],"Freestanding while peeking");
UI.AddCheckbox(["Misc.", "Better auto peek","Better auto peek"],"Early auto stop while peeking");
UI.AddCheckbox(["Misc.", "Better auto peek","Better auto peek"],"Prefer safe point while peeking");

//pasted from https://www.onetap.com/threads/autopeek-customizable-radius-useless.36182/
UI.AddCheckbox(["Misc.", "Better auto peek","Better auto peek"],"Custom color (mb ugly)");
UI.AddColorPicker(["Misc.", "Better auto peek","Better auto peek"], "fill color");
UI.AddColorPicker(["Misc.", "Better auto peek","Better auto peek"],"outline color");

var scout_dmg_prev = UI.GetValue(["Rage", "Target", "SSG08", "Minimum damage"]);
var awp_dmg_prev = UI.GetValue(["Rage", "Target", "AWP", "Minimum damage"]);
var r8_dmg_prev = UI.GetValue(["Rage", "Target", "Revolver", "Minimum damage"]);

var scout_hc_prev = UI.GetValue(["Rage", "Accuracy", "SSG08", "Hitchance"]);
var awp_hc_prev = UI.GetValue(["Rage", "Accuracy", "AWP", "Hitchance"]);
var r8_hc_prev = UI.GetValue(["Rage", "Accuracy", "Revolver", "Hitchance"]);

var scout_autostop = UI.GetValue(["Rage", "Accuracy",  "SSG08", "Auto stop mode"]);
var awp_autostop = UI.GetValue(["Rage", "Accuracy",  "AWP", "Auto stop mode"]);
var r8_autostop = UI.GetValue(["Rage", "Accuracy", "Revolver", "Auto stop mode"]);

var scout_sp = UI.GetValue(["Rage", "Accuracy", "SSG08", "Prefer safe point"]);
var awp_sp = UI.GetValue(["Rage", "Accuracy",  "AWP", "Prefer safe point"]);
var r8_sp = UI.GetValue(["Rage", "Accuracy", "Revolver", "Prefer safe point"]);
function autopeek()
{
    var scout_hc = UI.GetValue(["Misc.", "Better auto peek","Better auto peek", "scout hc"]);
    var awp_hc = UI.GetValue(["Misc.", "Better auto peek","Better auto peek", "awp hc"]);
    var r8_hc = UI.GetValue(["Misc.", "Better auto peek","Better auto peek", "r8 hc"]);

    var scout_dmg = UI.GetValue(["Misc.", "Better auto peek","Better auto peek", "scout dmg"]);
    var awp_dmg = UI.GetValue(["Misc.", "Better auto peek","Better auto peek", "awp dmg"]);
    var r8_dmg = UI.GetValue(["Misc.", "Better auto peek","Better auto peek", "r8 dmg"]);
    setEnabled()
    if(UI.GetValue(["Config", "Scripts", "JS Keybinds", "better autopeek"]))
    {
        if(!UI.GetValue(["Misc.", "Keys", "Key assignment", "Auto peek"]))
        {
            UI.ToggleHotkey(["Misc.", "Keys", "Key assignment", "Auto peek"]);
        }
        //freestanding
        if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Freestanding while peeking"]))
        {
            UI.SetValue(["Rage", "Anti Aim", "Directions", "Auto direction"], 1);
        }
        else
        {
            UI.SetValue(["Rage", "Anti Aim", "Directions", "Auto direction"], 0);
        }
        //hitchance
        if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Override hitchance"]))
        {
            UI.SetValue(["Rage", "Accuracy", "SSG08", "Hitchance"], scout_hc);
            UI.SetValue(["Rage", "Accuracy", "AWP", "Hitchance"], awp_hc);
            UI.SetValue(["Rage", "Accuracy", "Revolver", "Hitchance"], r8_hc);
        }
        //dmg
        if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Override damage"]))
        {
            UI.SetValue(["Rage", "Target", "SSG08", "Minimum damage"], scout_dmg);
            UI.SetValue(["Rage", "Target", "AWP", "Minimum damage"], awp_dmg);
            UI.SetValue(["Rage", "Target", "Revolver", "Minimum damage"], r8_dmg);
        }
        //autostop
        if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Early auto stop while peeking"]))
        {
            UI.SetValue(["Rage", "Accuracy",  "SSG08", "Auto stop mode"], 2);
            UI.SetValue(["Rage", "Accuracy",  "Revolver", "Auto stop mode"], 2);
            UI.SetValue(["Rage", "Accuracy",  "AWP", "Auto stop mode"], 2);
        }
        //safe points
        if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Prefer safe point while peeking"]))
        {
            UI.SetValue(["Rage", "Accuracy", "SSG08", "Prefer safe point"], 1);
            UI.SetValue(["Rage", "Accuracy", "AWP", "Prefer safe point"], 1);
            UI.SetValue(["Rage", "Accuracy", "Revolver", "Prefer safe point"], 1);
        }
    }
    else
    {
        if(UI.GetValue(["Misc.", "Keys", "Key assignment", "Auto peek"]))
        {
            UI.ToggleHotkey(["Misc.", "Keys", "Key assignment", "Auto peek"]);
        }
        UI.SetValue(["Rage", "Accuracy", "SSG08", "Hitchance"], scout_hc_prev);
        UI.SetValue(["Rage", "Accuracy", "AWP", "Hitchance"], awp_hc_prev);
        UI.SetValue(["Rage", "Accuracy", "Revolver", "Hitchance"], r8_hc_prev);

        UI.SetValue(["Rage", "Target", "SSG08", "Minimum damage"], scout_dmg_prev);
        UI.SetValue(["Rage", "Target", "AWP", "Minimum damage"], awp_dmg_prev);
        UI.SetValue(["Rage", "Target", "Revolver", "Minimum damage"], r8_dmg_prev);

        UI.SetValue(["Rage", "Accuracy",  "SSG08", "Auto stop mode"], scout_autostop);
        UI.SetValue(["Rage", "Accuracy",  "AWP", "Auto stop mode"], awp_autostop);
        UI.SetValue(["Rage", "Accuracy",  "Revolver", "Auto stop mode"], r8_autostop);

        UI.SetValue(["Rage", "Accuracy", "SSG08", "Prefer safe point"], scout_sp);
        UI.SetValue(["Rage", "Accuracy", "AWP", "Prefer safe point"], awp_sp);
        UI.SetValue(["Rage", "Accuracy", "Revolver", "Prefer safe point"], r8_sp);
    }
}

var chislo_p = 3.141592653589793;  //Math.PI *просто существует*
var state = [
    false, // moving
    false, // in air
    false, // has shot
    false // has to move
]
var saved_pos = Entity.GetLocalPlayer() != null && Entity.IsAlive(Entity.GetLocalPlayer()) && Entity.GetRenderOrigin(Entity.GetLocalPlayer()) || [0, 0, 0];
var latest_velocity = 0;

function d2r(num) { return num*(chislo_p/180) }
function draw_circle_3d(x, y, z, radius, degrees, start_at, clr, filled, fill_clr) {
    var accuracy = 8;
    var old_x, old_y;
    degrees = degrees < 361 && degrees || 360; degrees = degrees > -1 && degrees || 0
    start_at = start_at+1
    for (rot=start_at; rot < degrees+start_at+1; rot+=start_at*accuracy) {
        rot_r = d2r(rot)
        line_x = radius * Math.cos(rot_r) + x, line_y = radius * Math.sin(rot_r) + y
        var curr = Render.WorldToScreen([line_x, line_y, z]), cur = Render.WorldToScreen([x, y, z]);
        if (cur[0] != null && curr[0] != null && old_x != null) {
            if (filled)
                Render.Polygon([ [curr[0], curr[1]], [old_x, old_y], [cur[0], cur[1]] ], fill_clr)
            Render.Line(curr[0], curr[1], old_x, old_y, clr)
        }
        old_x = curr[0], old_y = curr[1];
    }
}


function draw()
{
    var local = Entity.GetLocalPlayer();
    if (local == null || !Entity.IsAlive(local) || !UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Custom color (mb ugly)"])) return;
    var pos = Entity.GetRenderOrigin(local);
    var distance_x = Math.floor(pos[0]-saved_pos[0]), distance_y = Math.floor(pos[1]-saved_pos[1]), distance = distance_x+distance_y;
    var flags = Entity.GetProp(local, "CBasePlayer", "m_fFlags");
    var color = UI.GetColor(["Misc.", "Better auto peek","Better auto peek","outline color"]), color2 = UI.GetColor(["Misc.", "Better auto peek","Better auto peek", "fill color"]);
    if (distance_x > 700 || distance_x < -700 || distance_y > 700 || distance_y < -700) {
        if (!state[1])
            saved_pos[0] = pos[0], saved_pos[1] = pos[1], saved_pos[2] = pos[2]
    }

    state[1] = flags == 256
    state[0] = Input.IsKeyPressed(0x57) || Input.IsKeyPressed(0x41) || Input.IsKeyPressed(0x53) || Input.IsKeyPressed(0x44)
    state[3] = !state[0] && !state[1]
    if (state[2] && latest_velocity > 6) state[3] = true

    if (UI.GetValue(["Config", "Scripts", "JS Keybinds", "better autopeek"])) {
        draw_circle_3d(saved_pos[0], saved_pos[1], saved_pos[2], 16, 360, 0, color, true, color2);
    } else {
        saved_pos[0] = pos[0], saved_pos[1] = pos[1], saved_pos[2] = pos[2]
    }
    if (state[3]) {
        if (Math.floor(pos[0]) == Math.floor(saved_pos[0]) && Math.floor(pos[1]) == Math.floor(saved_pos[1]) || distance_x > -8 && distance_x < 8 && distance_y > -8 && distance_y < 8) {
            state[3] = false
            state[2] = false
        }
    }
}

function setEnabled()
{
    //hitchance
    if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Override hitchance"]))
    {
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "scout hc"], 1);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "awp hc"], 1);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "r8 hc"], 1);
    }
    else
    {
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "scout hc"], 0);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "awp hc"], 0);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "r8 hc"], 0);
    }
    //damage
    if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Override damage"]))
    {
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "scout dmg"], 1);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "awp dmg"], 1);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "r8 dmg"], 1);
    }
    else
    {
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "scout dmg"], 0);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "awp dmg"], 0);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "r8 dmg"], 0);
    }
    //color
    if(UI.GetValue(["Misc.", "Better auto peek","Better auto peek","Custom color (mb ugly)"]))
    {
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "fill color"], 1);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "outline color"], 1);
    }
    else
    {
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "fill color"], 0);
        UI.SetEnabled(["Misc.", "Better auto peek","Better auto peek", "outline color"], 0);
    }
}

Cheat.RegisterCallback("Draw", "draw");
Cheat.RegisterCallback("CreateMove", "autopeek");
Пожалуйста, авторизуйтесь для просмотра ссылки.
 

Вложения

Забаненный
Статус
Оффлайн
Регистрация
19 Май 2020
Сообщения
124
Реакции[?]
45
Поинты[?]
1K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
1641579091629.pngЛ
 
Сверху Снизу