AntiAFk plugin bypass

This commit is contained in:
MrGeorgen
2020-04-28 13:28:12 +02:00
parent 9c7b405c94
commit eb1ec1383f
3 changed files with 16 additions and 3 deletions

View File

@ -29,6 +29,7 @@ var doing;
var calcInterval;
var authInterval;
var reconnectinterval;
var antiAntiAFk;
webserver.restartQueue = config.reconnect.notConnectedQueueEnd;
if (config.webserver) {
webserver.createServer(config.ports.web); // create the webserver
@ -107,6 +108,7 @@ function join() {
webserver.isInQueue = true;
activity("Starting the queue...");
let finishedQueue = false;
antiAntiAfkmsg();
client.on("packet", (data, meta) => { // each time 2b2t sends a packet
switch (meta.name) {
case "map_chunk":
@ -208,6 +210,7 @@ function join() {
server.on('login', (newProxyClient) => { // handle login
setTimeout(sendChunks, 50)
if (config.antiAntiAFK) clearInterval(antiAntiAFk);
newProxyClient.write('login', loginpacket);
newProxyClient.write('position', {
x: 0,
@ -237,6 +240,9 @@ function join() {
filterPacketAndSend(data, meta, client);
//console.log("meta: " + JSON.stringify(meta) + "\ndata: " + JSON.stringify(data))
});
newProxyClient.on("end", () => {
antiAntiAfkmsg();
})
proxyClient = newProxyClient;
});
@ -453,6 +459,12 @@ function calcTime(msg) {
}
function antiAntiAfkmsg() {
if (config.antiAntiAFK) antiAntiAFk = setInterval(function () {
client.write("chat", { message: "{\"text\":\">\"}", position: 1 })
}, 50000)
}
module.exports = {
startQueue: function () {
startQueuing();