48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
const readline = require('readline')
|
|
const rl = readline.createInterface({
|
|
input: process.stdin,
|
|
output: process.stdout,
|
|
prefix: '> '
|
|
})
|
|
|
|
const { createBots } = require('./bot.js')
|
|
// const commandHandler = require('./commands.js')
|
|
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
const moment = require('moment')
|
|
|
|
let filepath = path.join('logs', moment().format('YYYY-MM-DD') + '.log')
|
|
if (fs.existsSync(filepath)) {
|
|
const suspath = filepath + '-'
|
|
let i = 0
|
|
while (fs.existsSync(filepath)) {
|
|
filepath = suspath + (i++)
|
|
}
|
|
}
|
|
fs.writeFileSync(filepath, '')
|
|
|
|
const servers = [
|
|
'kaboom.pw:25565:kaboom',
|
|
's.veast.network:25565:kaboom',
|
|
'play.cyclenet.eu:25560:kaboom',
|
|
// 'legunepw.apexmc.co:25565:kaboom',
|
|
'ssandcat.aternos.me:25565:vanilla'
|
|
// 'kittyandhawk.ddns.net:25565:vanilla'
|
|
]
|
|
|
|
const bots = createBots(servers, {
|
|
username: ' ',
|
|
prefix: "'",
|
|
colors: { primary: 'green', secondary: 'dark_green', error: 'red' },
|
|
version: '1.17.1',
|
|
randomizeUsername: true,
|
|
autoReconnect: true
|
|
// 'online-mode': { enabled: false, username: 'removed lol', password: null }
|
|
})
|
|
|
|
bots.forEach((bot) => {
|
|
bot.console.filepath = filepath
|
|
bot.console.setRl(rl)
|
|
bot.commands.loadFromDir('commands')
|
|
})
|