forked from wmantly/mc-bot-town
add logon command
This commit is contained in:
parent
39590ffefa
commit
e4f0f6db88
@ -15,11 +15,36 @@ module.exports = {
|
||||
},
|
||||
'say': {
|
||||
desc: `Make the bot say stuff in chat`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242'],
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut',],
|
||||
ignoreLock: true,
|
||||
async function(from, ...messages){
|
||||
await this.say((messages || []).join(' '));
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
'logon': {
|
||||
desc: `Have bot log on for 10 seconds'`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut',],
|
||||
ignoreLock: true,
|
||||
async function(from, botName){
|
||||
this.__unLockCommand();
|
||||
|
||||
if(botName in his.constructor.bots){
|
||||
let bot = this.constructor.bots[botName];
|
||||
|
||||
if(!bot.isReady){
|
||||
try{
|
||||
await bot.connect();
|
||||
var clear = setTimeout(()=> bot.quit(), 10000);
|
||||
bot.whisper(from, 'I am ready')
|
||||
}catch(error){
|
||||
console.log('inv error connecting to bot');
|
||||
this.whisper('Bot is not available right now, try again in 30 seconds.');
|
||||
}
|
||||
}else{
|
||||
await this.whisper(from, `Bot ${bot.bot.entity.username} Already online`);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -7,111 +7,111 @@ let myAccounts = ['wmantly', 'useless666', 'tux4242']
|
||||
let germans = ['YTMatze', 'mytzor']
|
||||
|
||||
let townMemebers = [
|
||||
'wmantly', 'useless666', 'tux4242',
|
||||
'VinceNL',
|
||||
'Ethan63020', 'Ethan63021',
|
||||
'pi_chef',
|
||||
'EXLAlphaWolf', 'Sillychubbs',
|
||||
'BearSkates420', 'hloop',
|
||||
'ogeiDNight', 'BobinaBlu', 'Roby_G_27',
|
||||
'kawiimeowz', 'RaindropCake24', 'KimiKava',
|
||||
'Keebyys',
|
||||
'YTMatze', 'mytzor',
|
||||
'jj_disaster', 'Cuttaway',
|
||||
'sonic_joe',
|
||||
'wmantly', 'useless666', 'tux4242',
|
||||
'VinceNL',
|
||||
'Ethan63020', 'Ethan63021',
|
||||
'pi_chef',
|
||||
'EXLAlphaWolf', 'Sillychubbs',
|
||||
'BearSkates420', 'hloop',
|
||||
'ogeiDNight', 'BobinaBlu', 'Roby_G_27',
|
||||
'kawiimeowz', 'RaindropCake24', 'KimiKava',
|
||||
'Keebyys',
|
||||
'YTMatze', 'mytzor',
|
||||
'jj_disaster', 'Cuttaway',
|
||||
'sonic_joe',
|
||||
]
|
||||
|
||||
let sites = {
|
||||
fo: {
|
||||
bot: 'jimin',
|
||||
desc: `Get an invite to the Farming outpost.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', 'pi_chef', '1_cut', 'nootbot', 'VinceNL', 'Ethan63020', 'Ethan63021', 'KimiKava', 'kawiimeowz', 'RaindropCake24', 'AndyNyg', 'AndyNyg_II'],
|
||||
},
|
||||
guardian: {
|
||||
bot: 'art',
|
||||
desc: 'blah',
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot'],
|
||||
},
|
||||
fo2: {
|
||||
bot: 'henry',
|
||||
desc: `Get an invite to the Farming outpost 2.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot'],
|
||||
},
|
||||
foend: {
|
||||
bot: 'ez',
|
||||
desc: `Get an invite to the Farming outpost in the end.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut',],
|
||||
},
|
||||
sb: {
|
||||
bot: 'owen',
|
||||
desc: `Get an invite to the Sky Base.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot'],
|
||||
},
|
||||
core: {
|
||||
bot: 'nova',
|
||||
desc: `Get an invite to the Core.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot', 'AndyNyg', 'AndyNyg_II','Lost_Imback', 'KimiKava', 'kawiimeowz', 'RaindropCake24',],
|
||||
},
|
||||
art: {
|
||||
bot: 'art',
|
||||
desc: 'Invite to art',
|
||||
allowed: ['wmantly', 'useless666', 'tux4242']
|
||||
},
|
||||
german: {
|
||||
bot: 'linda',
|
||||
desc: `Get an invite you Germans area.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'owenshorts', 'VinceNL', 'Ethan63020', 'Ethan63021', 'pi_chef', 'YTMatze', 'mytzor', 'pi_chef', '1_cut', 'nootbot', 'Lost_Imback',],
|
||||
},
|
||||
fo: {
|
||||
bot: 'jimin',
|
||||
desc: `Get an invite to the Farming outpost.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut', 'nootbot', 'VinceNL', 'Ethan63020', 'Ethan63021', 'KimiKava', 'kawiimeowz', 'RaindropCake24', 'AndyNyg', 'AndyNyg_II'],
|
||||
},
|
||||
guardian: {
|
||||
bot: 'art',
|
||||
desc: 'blah',
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot'],
|
||||
},
|
||||
fo2: {
|
||||
bot: 'henry',
|
||||
desc: `Get an invite to the Farming outpost 2.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot'],
|
||||
},
|
||||
foend: {
|
||||
bot: 'ez',
|
||||
desc: `Get an invite to the Farming outpost in the end.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut',],
|
||||
},
|
||||
sb: {
|
||||
bot: 'owen',
|
||||
desc: `Get an invite to the Sky Base.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot'],
|
||||
},
|
||||
core: {
|
||||
bot: 'nova',
|
||||
desc: `Get an invite to the Core.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'pi_chef', '1_cut', 'Ethan63020', 'Ethan63021', 'VinceNL', 'nootbot', 'AndyNyg', 'AndyNyg_II','Lost_Imback', 'KimiKava', 'kawiimeowz', 'RaindropCake24',],
|
||||
},
|
||||
art: {
|
||||
bot: 'art',
|
||||
desc: 'Invite to art',
|
||||
allowed: ['wmantly', 'useless666', 'tux4242']
|
||||
},
|
||||
german: {
|
||||
bot: 'linda',
|
||||
desc: `Get an invite you Germans area.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'owenshorts', 'VinceNL', 'Ethan63020', 'Ethan63021', 'pi_chef', 'YTMatze', 'mytzor', 'pi_chef', '1_cut', 'nootbot', 'Lost_Imback',],
|
||||
},
|
||||
}
|
||||
|
||||
function getSiteFromBot(name){
|
||||
for(let site in sites){
|
||||
if(sites[site].bot === name){
|
||||
return sites[site];
|
||||
}
|
||||
}
|
||||
for(let site in sites){
|
||||
if(sites[site].bot === name){
|
||||
return sites[site];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
'.invite': {
|
||||
desc: `The bot will /accept an /invite from you.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'owenshorts', 'pi_chef'],
|
||||
ignoreLock: true,
|
||||
async function(from){
|
||||
await this.whisper('Coming');
|
||||
await this.say(`/accept`);
|
||||
}
|
||||
},
|
||||
'.invite': {
|
||||
desc: `The bot will /accept an /invite from you.`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242', 'owenshorts', 'pi_chef', '1_cut',],
|
||||
ignoreLock: true,
|
||||
async function(from){
|
||||
await this.whisper('Coming');
|
||||
await this.say(`/accept`);
|
||||
}
|
||||
},
|
||||
'inv': {
|
||||
desc: `Have bot.\n Site -- one'`,
|
||||
ignoreLock: true,
|
||||
async function(from, site){
|
||||
this.__unLockCommand();
|
||||
desc: `Have bot.\n Site -- one'`,
|
||||
ignoreLock: true,
|
||||
async function(from, site){
|
||||
this.__unLockCommand();
|
||||
|
||||
if(sites[site] && sites[site].allowed.includes(from)){
|
||||
let bot = this.constructor.bots[sites[site].bot];
|
||||
if(sites[site] && sites[site].allowed.includes(from)){
|
||||
let bot = this.constructor.bots[sites[site].bot];
|
||||
|
||||
if(!bot.isReady){
|
||||
try{
|
||||
await bot.connect();
|
||||
}catch(error){
|
||||
console.log('inv error connecting to bot');
|
||||
this.whisper('Bot is not available right now, try again in 30 seconds.');
|
||||
}
|
||||
var clear = setTimeout(()=> bot.quit(), 10000);
|
||||
}
|
||||
await bot.bot.chat(`/invite ${from}`);
|
||||
await bot.whisper(from, `accept invite from ${bot.bot.entity.username} within 10 seconds...`);
|
||||
bot.on('message', (message) =>{
|
||||
if(message.toString() === `${from} teleported to you.`){
|
||||
if(clear){
|
||||
clearTimeout(clear);
|
||||
bot.quit();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if(!bot.isReady){
|
||||
try{
|
||||
await bot.connect();
|
||||
}catch(error){
|
||||
console.log('inv error connecting to bot');
|
||||
this.whisper('Bot is not available right now, try again in 30 seconds.');
|
||||
}
|
||||
var clear = setTimeout(()=> bot.quit(), 10000);
|
||||
}
|
||||
await bot.bot.chat(`/invite ${from}`);
|
||||
await bot.whisper(from, `accept invite from ${bot.bot.entity.username} within 10 seconds...`);
|
||||
bot.on('message', (message) =>{
|
||||
if(message.toString() === `${from} teleported to you.`){
|
||||
if(clear){
|
||||
clearTimeout(clear);
|
||||
bot.quit();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user