forked from wmantly/mc-bot-town
AI works here
This commit is contained in:
@@ -166,6 +166,20 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
},
|
||||
'resupply': {
|
||||
desc: 'Trigger farm resupply manually',
|
||||
allowed: ['wmantly', 'useless666', 'tux4242'],
|
||||
ignoreLock: true,
|
||||
async function(from, botName) {
|
||||
const target = botName ? this.constructor.bots[botName] : this;
|
||||
if (!target) return this.whisper(from, 'Unknown bot');
|
||||
const fs = target.plunginsLoaded['FarmSupply'];
|
||||
if (!fs) return this.whisper(from, 'FarmSupply not loaded');
|
||||
this.whisper(from, 'Starting resupply...');
|
||||
await fs.resupply();
|
||||
this.whisper(from, 'Resupply complete');
|
||||
}
|
||||
},
|
||||
'dismiss': {
|
||||
desc: `Send a bot offline`,
|
||||
allowed: ['wmantly', 'useless666', 'tux4242'],
|
||||
|
||||
@@ -1,11 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
const { sleep } = require('../../utils');
|
||||
const { CJbot } = require('../../model/minecraft');
|
||||
|
||||
// Owner players who can run admin commands
|
||||
const owners = ['wmantly', 'useless666', 'tux4242'];
|
||||
// Team players who can use basic storage features
|
||||
const team = [...owners, 'pi_chef', 'Ethan', 'Vince_NL'];
|
||||
const _team = [...owners, 'pi_chef', 'Ethan', 'Vince_NL'];
|
||||
|
||||
// Dynamic team list that includes all bot usernames
|
||||
Object.defineProperty(Array.prototype, '_includesWithBots', { value: undefined, writable: true });
|
||||
const team = new Proxy(_team, {
|
||||
get(target, prop) {
|
||||
if (prop === 'includes') {
|
||||
return (name) => {
|
||||
if (target.includes(name)) return true;
|
||||
for (const bot of Object.values(CJbot.bots)) {
|
||||
if (bot.bot && bot.bot.entity && bot.bot.entity.username === name) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
return target[prop];
|
||||
}
|
||||
});
|
||||
|
||||
const botSlots = [0, 1, 2, 3, 9, 10, 11, 12, 18, 19, 20, 21];
|
||||
const customerSlots = [5, 6, 7, 8, 14, 15, 16, 17, 23, 24, 25, 26];
|
||||
|
||||
Reference in New Issue
Block a user