diff --git a/src/agent/coder.js b/src/agent/coder.js index 815ff39..0551032 100644 --- a/src/agent/coder.js +++ b/src/agent/coder.js @@ -94,11 +94,14 @@ export class Coder { let code_return = null; let failures = 0; + const interrupt_return = {success: true, message: null, interrupted: true, timedout: false}; for (let i=0; i<5; i++) { if (this.agent.bot.interrupt_code) - return {success: true, message: null, interrupted: true, timedout: false}; + return interrupt_return; console.log(messages) let res = await this.agent.prompter.promptCoding(messages); + if (this.agent.bot.interrupt_code) + return interrupt_return; let contains_code = res.indexOf('```') !== -1; if (!contains_code) { if (res.indexOf('!newAction') !== -1) { diff --git a/src/agent/commands/index.js b/src/agent/commands/index.js index 264e7b6..a71916b 100644 --- a/src/agent/commands/index.js +++ b/src/agent/commands/index.js @@ -95,7 +95,7 @@ export async function executeCommand(agent, message) { export function getCommandDocs() { let docs = `\n*COMMAND DOCS\n You can use the following commands to perform actions and get information about the world. Use the commands with the syntax: !commandName or !commandName("arg1", 1.2, ...) if the command takes arguments.\n - Do not use codeblocks. Only use one command in each response, trailing commands and comments will be ignored. Use these commands frequently in your responses!\n`; + Do not use codeblocks. Only use one command in each response, trailing commands and comments will be ignored.\n`; for (let command of commandList) { docs += command.name + ': ' + command.description + '\n'; if (command.params) { diff --git a/src/agent/library/skills.js b/src/agent/library/skills.js index 2ed1c67..829ccbe 100644 --- a/src/agent/library/skills.js +++ b/src/agent/library/skills.js @@ -503,7 +503,7 @@ export async function placeBlock(bot, blockType, x, y, z) { log(bot, `${blockType} already at ${targetBlock.position}.`); return false; } - const empty_blocks = ['air', 'water', 'lava', 'grass', 'tall_grass', 'snow', 'dead_bush', 'fern']; + const empty_blocks = ['air', 'water', 'lava', 'grass', 'short_grass', 'tall_grass', 'snow', 'dead_bush', 'fern']; if (!empty_blocks.includes(targetBlock.name)) { log(bot, `${blockType} in the way at ${targetBlock.position}.`); const removed = await breakBlockAt(bot, x, y, z);