22 lines
540 B
JavaScript
22 lines
540 B
JavaScript
|
const mineflayer = require('mineflayer')
|
||
|
const fs = require('fs');
|
||
|
|
||
|
global.bot = null
|
||
|
|
||
|
module.exports = {
|
||
|
get: function(){
|
||
|
return global.bot
|
||
|
},
|
||
|
create: function(){
|
||
|
const data = fs.readFileSync('.env').toString();
|
||
|
const sp = data.split('\n')
|
||
|
global.bot = mineflayer.createBot({
|
||
|
host: 'g8FtmrY8VbkBzbgN5fsDu8QxYW8Nubkd.tpgc.me',
|
||
|
port: 25565,
|
||
|
auth: 'microsoft',
|
||
|
username: sp[0],
|
||
|
password: sp[1]
|
||
|
})
|
||
|
return global.bot
|
||
|
}
|
||
|
}
|