-
Автор темы
- #1
Нужно переписать js с onetap alpha на stable версию
Вот сурс:
Вот сурс:
Код:
//Menu Stuff
var states = ["Global", "Stand", "Walk", "Move", "Duck", "Air", "Auto dir", "Manual"];
var pitches = ["Off", "Down", "Emotion", "Zero", "Up", "Fake up", "Fake down"];
const aa = UI.AddMultiDropdown(["Rage", "Anti Aim", "General"], "Defensive State", states);
const pitchvalues = UI.AddDropdown(["Rage", "Anti Aim", "General"], "Defensive Pitch", pitches, 0);
const flickfreq = UI.AddSliderInt(["Rage", "Anti Aim", "General"], "Flick Frequency (Ticks)", 1, 14);
UI.SetValue(["Config", "Cheat", "General", "Restrictions"], 0);
//Functions
function time_to_ticks(t) {
return Math.floor(.5 + (t / Globals.TickInterval()));
}
var defensive = {
active: false,
until: 0,
ticks: 0,
lastsimtime: 0,
}
function get_defensive() {
var cursimtime = time_to_ticks(Entity.GetProp(Entity.GetLocalPlayer(), 'CBaseEntity', 'm_flSimulationTime'))
var simdif = cursimtime - defensive.lastsimtime
if (simdif < 0) {
defensive.until = Global.Tickcount() + Math.abs(simdif) - time_to_ticks(Local.Latency())
defensive.ticks = defensive.until - Global.Tickcount()
}
dt = UI.GetValue(['Rage', 'Exploits', 'Keys', 'Key assignment', 'Double tap'])
if (dt == 1) {
defensive.active = defensive.until > Global.Tickcount()
defensive.lastsimtime = cursimtime
defensive.time = defensive.ticks - (defensive.until - Global.Tickcount())
} else {
defensive.active = false;
}
return defensive.active;
}
function setPitch(pitchValue) {
var enabledStates = UI.GetValue(aa);
for (var i = 0; i < states.length; i++) {
if (enabledStates & (1 << i)) {
var path = ["Rage", "Anti Aim", states[i], "Pitch mode"];
UI.SetValue(path, pitchValue);
}
}
}
function defensivePitch() {
var defensiveActive = get_defensive();
var defensivePitchExploit = UI.GetValue(pitchvalues);
if (defensiveActive && defensivePitchExploit != 0) {
if (Global.Tickcount() % UI.GetValue(flickfreq) == 0) {
setPitch(defensivePitchExploit);
}
} else {
setPitch(1); // Pitch down
}
}
function Unload() {
setPitch(1); // Pitch down
}
//Callbacks
Cheat.RegisterCallback("CreateMove", "defensivePitch");
Cheat.RegisterCallback("Unload", "Unload");