From 5cfe794d5fa0852d157b7c2722d678e350416ed1 Mon Sep 17 00:00:00 2001 From: Kolby Nottingham Date: Thu, 21 Nov 2024 13:40:18 -0800 Subject: [PATCH] pause item collecting after giving item --- src/agent/commands/actions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/agent/commands/actions.js b/src/agent/commands/actions.js index 8728ad5..06c5476 100644 --- a/src/agent/commands/actions.js +++ b/src/agent/commands/actions.js @@ -150,7 +150,11 @@ export const actionsList = [ 'num': { type: 'int', description: 'The number of items to give.', domain: [1, Number.MAX_SAFE_INTEGER] } }, perform: runAsAction(async (agent, player_name, item_name, num) => { + const modes = agent.bot.modes; + modes.pause('item_collecting'); await skills.giveToPlayer(agent.bot, item_name, player_name, num); + await new Promise(resolve => setTimeout(resolve, 3000)); + modes.unpause('item_collecting'); }) }, {