Хорошо, моя функция не работает, когда я пытаюсь это сделать
function esp() {
(function() {
let initialize = function(data) {
let regex = /if\(!\w+\['(\w+)']\)continue/;
let result = regex.exec(data);
if (result) {
const inView = result[1];
const push = Array.prototype.push;
Array.prototype.push = function(...args) {
push.apply(this, args);
if (args[0] instanceof Object && args[0].isPlayer) {
Object.defineProperty(args[0], inView, {value: true, configurable: false});
}
}
}
}
const decode = window.TextDecoder.prototype.decode;
window.TextDecoder.prototype.decode = function(...args) {
let data = decode.apply(this, args);
if (data.length > 1050000) { //1050000 ideal val
console.log(data);
initialize(data);
}
return data;
}
})();
}
window.addEventListener('keydown', (event) => {
if (document.activeElement !== document.body) return;
var char = event.key.toUpperCase();
switch (char) {
case 'Q':
esp();
break;
}
}, 750);
Но это не работает, только когда я пытаюсь go использовать функцию, когда Q не работает, но если я помещаю esp (); сразу после функции он работает. Он также работает, когда я делаю это, но мне нужно, чтобы он работал при нажатии клавиши
(function() {
let initialize = function(data) {
let regex = /if\(!\w+\['(\w+)']\)continue/;
let result = regex.exec(data);
if (result) {
const inView = result[1];
const push = Array.prototype.push;
Array.prototype.push = function(...args) {
push.apply(this, args);
if (args[0] instanceof Object && args[0].isPlayer) {
Object.defineProperty(args[0], inView, {value: true, configurable: false});
}
}
}
}
const decode = window.TextDecoder.prototype.decode;
window.TextDecoder.prototype.decode = function(...args) {
let data = decode.apply(this, args);
if (data.length > 1050000) { //1050000 ideal val
console.log(data);
initialize(data);
}
return data;
}
})();
И эта функция внутри esp help будет очень признательна