im trying to set runOurCode true then false every 5 seconds i have tryed setInterval,setTimout,forLoop and still dint worked asked some friends but everyone is offline rn :/
var editingCode;
let runOurCode = false
const oldFrame = requestAnimationFrame;
WebSocket.prototype.send = new Proxy(WebSocket.prototype.send, {
apply: function(target, scope, args) {
if (typeof(args[0]) === 'string') {
let json = JSON.parse(args[0]);
if (json[0] === 3) {
editingCode = (json[1])
}
}
let data = target.apply(scope, args);
return data;
}
})
WebSocket.prototype.send = new Proxy(WebSocket.prototype.send, {
apply: function(target, scope, args) {
if (typeof(args[0]) === 'string') {
let json = JSON.parse(args[0]);
if (runOurCode) {
target.apply(scope, [`[5,77]`]) // u dont need function here (MY BAD)
runOurCode = false // set back to false so it doesnt keep drinking
}
}
let run = false
document.addEventListener("keypress", e => {
if (e.code === "KeyC") {
runOurCode = true
}
})
let data = target.apply(scope, args);
return data;
}
})