mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-21 21:52:07 +02:00
coding interrupt, small fixes
This commit is contained in:
parent
8d37dc12d2
commit
a620971ed2
3 changed files with 6 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue