From 883f73eef5bcdebd6c3fc43eb67fd0752afcdb61 Mon Sep 17 00:00:00 2001 From: Kolby Nottingham Date: Thu, 12 Dec 2024 18:53:24 -0800 Subject: [PATCH] fixed example --- example_tasks.json | 1 - src/agent/tasks.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/example_tasks.json b/example_tasks.json index d5305ba..b579233 100644 --- a/example_tasks.json +++ b/example_tasks.json @@ -1,7 +1,6 @@ { "debug_single_agent": { "goal": "Just stand at a place and don't do anything", - "guidance": null, "initial_inventory": {}, "type": "debug" }, diff --git a/src/agent/tasks.js b/src/agent/tasks.js index 9dfa232..881b933 100644 --- a/src/agent/tasks.js +++ b/src/agent/tasks.js @@ -173,16 +173,16 @@ export class Task { bot.chat(`/tp ${name} ${Math.floor(pos.x + xOffset)} ${pos.y + 3} ${Math.floor(pos.z + zOffset)}`); await new Promise((resolve) => setTimeout(resolve, 200)); } - + if (this.data.agent_count && this.data.agent_count > 1) { + // TODO wait for other bots to join await new Promise((resolve) => setTimeout(resolve, 10000)); if (available_agents.length < this.data.agent_count) { console.log(`Missing ${this.data.agent_count - available_agents.length} bot(s).`); this.agent.cleanKill('Not all required players/bots are present in the world. Exiting.', 4); } - } - + if (this.data.goal) { await executeCommand(this.agent, `!goal("${this.data.goal}")`); }