mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 01:25:33 -05:00
remove ancient unused comments
This commit is contained in:
parent
3e19df5bc7
commit
ee1ddd46e3
5 changed files with 3 additions and 64 deletions
8
bot.js
8
bot.js
|
@ -28,11 +28,11 @@ const mineflayer = require('mineflayer');
|
|||
async function createBot(server, config, getBots, dcclient, rl) {
|
||||
const bot = new EventEmitter();
|
||||
bot.options = {
|
||||
username: /* process.argv[2] */ !server.kaboom ?
|
||||
username: !server.kaboom ?
|
||||
'ChomeNS_Bot' :
|
||||
randomstring.generate(8),
|
||||
host: /* process.argv[2] */ server.host,
|
||||
port: /* process.argv[3] ? Number(process.argv[3]) : 25565*/ server.port,
|
||||
host: server.host,
|
||||
port: server.port,
|
||||
version: config.version,
|
||||
kaboom: server.kaboom,
|
||||
checkTimeoutInterval: '30000',
|
||||
|
@ -75,8 +75,6 @@ async function createBot(server, config, getBots, dcclient, rl) {
|
|||
`Successfully logged in to: \`${bot.options.host}:${bot.options.port}\``,
|
||||
);
|
||||
bot.eaglercrashstarted = false;
|
||||
// await sleep(1500);
|
||||
// bot.createCore();
|
||||
|
||||
bot.vmoptions = {
|
||||
timeout: 2000,
|
||||
|
|
|
@ -39,19 +39,6 @@ module.exports = {
|
|||
bot.tellraw(selector, {text: `${err}`, color: 'red'});
|
||||
});
|
||||
}
|
||||
// if (args[0] === 'dineval') {
|
||||
// axios
|
||||
// .get('https://eval.dinhero21.repl.co', {
|
||||
// headers: {
|
||||
// data: args[1],
|
||||
// colors: 'minecraft',
|
||||
// },
|
||||
// }).then((res) => {
|
||||
// bot.tellraw(selector, {text: `${res.data}`}));
|
||||
// }).catch((e) => {
|
||||
// bot.tellraw(selector, {text: `${e}`, color: 'red'});
|
||||
// });
|
||||
// }
|
||||
},
|
||||
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
|
||||
if (args[0] === 'run') {
|
||||
|
|
|
@ -31,25 +31,10 @@ function inject(bot, _dcclient, config, rl) {
|
|||
log(prefix('&cERROR', typeof error === 'string' ? error : error.stack));
|
||||
};
|
||||
|
||||
// bot.consoleQueue = [];
|
||||
// const consoleQueueInterval = setInterval(function() {
|
||||
// if (!bot.messageLogging) return;
|
||||
// if (bot.consoleQueue.length > 50) bot.consoleQueue = [];
|
||||
// if (bot.consoleQueue[0] || bot.consoleQueue[0] === '') {
|
||||
// bot.console.log(bot.consoleQueue[0].substring(0, 10000));
|
||||
// bot.consoleQueue.shift();
|
||||
// }
|
||||
// }, 100);
|
||||
|
||||
bot.on('parsed_chat', (message) => {
|
||||
if (!bot.messageLogging) return;
|
||||
bot.console.log(message.toAnsi());
|
||||
});
|
||||
|
||||
// bot.once('end', () => {
|
||||
// clearInterval(consoleQueueInterval);
|
||||
// rl.removeAllListeners();
|
||||
// });
|
||||
}
|
||||
|
||||
function oneTimeInject(bot, _dcclient, config, rl) {
|
||||
|
@ -86,17 +71,11 @@ function oneTimeInject(bot, _dcclient, config, rl) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// if (line === '.clearconsolequeue') {
|
||||
// consoleQueue = [];
|
||||
// return;
|
||||
// }
|
||||
if (line === '.messagelogging on') {
|
||||
bot.consoleQueue = [];
|
||||
bot.messageLogging = true;
|
||||
return;
|
||||
}
|
||||
if (line === '.messagelogging off') {
|
||||
bot.consoleQueue = [];
|
||||
bot.messageLogging = false;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -93,15 +93,6 @@ function inject(bot, dcclient, config) {
|
|||
bot.console.error(e);
|
||||
}
|
||||
},
|
||||
// fillCore(useCore) {
|
||||
// const fillCommand = `/minecraft:fill ${core.start.x} ${core.start.y} ${core.start.z} ${core.end.x} ${core.end.y} ${core.end.z} command_block{CustomName:'{"text":"ChomeNS Bot Core","color":"yellow"}'}`;
|
||||
// if (useCore==true) {
|
||||
// bot.core.run(fillCommand);
|
||||
// } else {
|
||||
// bot.chat(fillCommand);
|
||||
// }
|
||||
// bot.emit('core_filled');
|
||||
// },
|
||||
};
|
||||
|
||||
function fillCore() {
|
||||
|
@ -113,21 +104,12 @@ function inject(bot, dcclient, config) {
|
|||
core.end = core.start.clone().translate(16, config.core.layers, 16).subtract(new Vec3(1, 1, 1));
|
||||
|
||||
bot.core.loopPlace();
|
||||
// core.fillCore();
|
||||
}
|
||||
|
||||
bot.on('position', fillCore);
|
||||
|
||||
const interval = setInterval(() => fillCore(), config.core.refillInterval);
|
||||
|
||||
// bot._client.on('block_change', (packet) => {
|
||||
// if (core.isCore(packet.location) && packet.type === 0) fillCore();
|
||||
// });
|
||||
|
||||
// bot._client.on('multi_block_change', (packet) => {
|
||||
// if (core.start === packet.chunkCoordinates || core.end === packet.chunkCoordinates) fillCore();
|
||||
// });
|
||||
|
||||
bot.once('end', () => {
|
||||
clearInterval(interval);
|
||||
});
|
||||
|
|
|
@ -47,30 +47,23 @@ function parsePlayerMessages(message, packet, bot) {
|
|||
// then here is all the player message parsing thing
|
||||
const raw = message.toMotd().substring(0, 32767);
|
||||
if (raw.match(/.* .*: .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/:.*/g, '').replace(/§#....../gm, '');
|
||||
const message = raw.split(': ')[1];
|
||||
bot.emit('message', username, message, packet.sender);
|
||||
} else if (raw.match(/.* .*\u203a .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u203a.*/g, '').replace(/§#....../gm, '').split(' ')[0];
|
||||
const message = raw.split('\u203a ')[1].substring(2);
|
||||
bot.emit('message', username, message, packet.sender);
|
||||
} else if (raw.match(/.* .*\u00BB .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
const username = raw.replace(/.*?\[.*?\] /g, '').replace(/\u00BB.*/g, '').replace(/§#....../gm, '').split(' ')[0];
|
||||
const message = raw.split('\u00BB ')[1].substring(2);
|
||||
bot.emit('message', username, message, packet.sender);
|
||||
} else if (raw.match(/<.*§r> .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
|
||||
const username = raw.substring(3).split('§r>')[0];
|
||||
const message = raw.split('§r> ')[1];
|
||||
|
||||
bot.emit('message', username, message, packet.sender);
|
||||
} else if (raw.match(/<.*> .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
|
||||
const username = raw.substring(3).split('>')[0];
|
||||
const message = raw.split('> ')[1];
|
||||
|
||||
|
|
Loading…
Reference in a new issue