mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-21 21:52:07 +02:00
cleaned comments, little fix
This commit is contained in:
parent
304fbc807c
commit
76aa9539fb
4 changed files with 7 additions and 4 deletions
|
@ -63,7 +63,7 @@ export class Agent {
|
|||
bannedFood: ["rotten_flesh", "spider_eye", "poisonous_potato", "pufferfish", "chicken"]
|
||||
};
|
||||
|
||||
if (save_data && save_data.self_prompt) {
|
||||
if (save_data && save_data.self_prompt) { // if we're loading memory and self-prompting was on, restart it, ignore init_message
|
||||
let prompt = save_data.self_prompt;
|
||||
if (init_message)
|
||||
prompt = `${init_message}\n${prompt}`;
|
||||
|
@ -114,7 +114,7 @@ export class Agent {
|
|||
}
|
||||
}
|
||||
let MAX_ATTEMPTS = 5;
|
||||
if (!self_prompt && this.self_prompter.on)
|
||||
if (!self_prompt && this.self_prompter.on) // message from user during self-prompting
|
||||
MAX_ATTEMPTS = 1; // immediately respond to this message, then let self-prompting take over
|
||||
for (let i=0; i<MAX_ATTEMPTS; i++) {
|
||||
if (self_prompt && this.self_prompter.on && this.self_prompter.interrupt) break;
|
||||
|
|
|
@ -250,7 +250,7 @@ export const actionsList = [
|
|||
name: '!stopSelfPrompt',
|
||||
description: 'Stop current action and self-prompting.',
|
||||
perform: async function (agent) {
|
||||
agent.self_prompter.stop(); // will stop and
|
||||
agent.self_prompter.stop();
|
||||
return 'Self-prompting stopped.';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export class History {
|
|||
}
|
||||
}
|
||||
|
||||
async save() {
|
||||
save() {
|
||||
// save history object to json file
|
||||
let data = {
|
||||
'name': this.name,
|
||||
|
|
|
@ -51,6 +51,9 @@ export async function craftRecipe(bot, itemName, num=1) {
|
|||
**/
|
||||
let placedTable = false;
|
||||
|
||||
if (itemName.endsWith('plank'))
|
||||
itemName += 's'; // catches common mistakes like "oak_plank" instead of "oak_planks"
|
||||
|
||||
// get recipes that don't require a crafting table
|
||||
let recipes = bot.recipesFor(mc.getItemId(itemName), null, 1, null);
|
||||
let craftingTable = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue