Answer the question
In order to leave comments, you need to log in
How to run 2 or more bots on 1 server using mineflayer?
I checked they go to different servers, but they don’t write to the same one:
{ Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }
const mineflayer = require('mineflayer');
const navigatePlugin = require('mineflayer-navigate')(mineflayer);
var vec3 = require('vec3');
var valera = mineflayer.createBot({
host: "naxomoB.aternos.me",
port: 25565,
username: 'Valera',
version: false
});
require(`./b.js`) // в b.js то же самое, но ник другой
fs.readdir("./mcbots/", (err, files) => {
if(err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js");
if(jsfile.length <= 0){
console.log("Add");
return;
}
jsfile.forEach((f, i) =>{
let props = require(`./mcbots/${f}`);
console.log(`${f} loaded!`);
props.run()
});
});
const mineflayer = require('mineflayer');
const navigatePlugin = require('mineflayer-navigate')(mineflayer);
var vec3 = require('vec3');
module.exports.run = async (bot, message, args) => {
var valera = mineflayer.createBot({
host: "naxomoB.aternos.me",
port: 25565,
username: 'Valera',
version: false
});
console.log('1')
}
module.exports.help = {
name: "valera"
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question