fixed furnace commands

This commit is contained in:
MaxRobinsonTheGreat 2024-10-10 20:04:02 -05:00
parent 5482a5dc7e
commit 7b77c395d0
2 changed files with 16 additions and 5 deletions

View file

@ -254,6 +254,14 @@ export const actionsList = [
return response;
}
},
{
name: '!clearFurnace',
description: 'Tak all items out of the nearest furnace.',
params: { },
perform: wrapExecution(async (agent) => {
await skills.clearNearestFurnace(agent.bot);
})
},
{
name: '!placeHere',
description: 'Place a given block in the current location. Do NOT use to build structures, only use for single blocks/torches.',

View file

@ -181,7 +181,7 @@ export async function smeltItem(bot, itemName, num=1) {
let total = 0;
let collected_last = true;
let smelted_item = null;
bot.mods.pause('unstuck');
bot.modes.pause('unstuck');
await new Promise(resolve => setTimeout(resolve, 200));
while (total < num) {
await new Promise(resolve => setTimeout(resolve, 10000));
@ -203,7 +203,7 @@ export async function smeltItem(bot, itemName, num=1) {
}
}
await bot.closeWindow(furnace);
bot.mods.unpause('unstuck');
bot.modes.unpause('unstuck');
if (placedFurnace) {
await collectBlock(bot, 'furnace', 1);
@ -228,11 +228,14 @@ export async function clearNearestFurnace(bot) {
* @example
* await skills.clearNearestFurnace(bot);
**/
let furnaceBlock = world.getNearestBlock(bot, 'furnace', 6);
let furnaceBlock = world.getNearestBlock(bot, 'furnace', 32);
if (!furnaceBlock) {
log(bot, `There is no furnace nearby.`)
log(bot, `No furnace nearby to clear.`);
return false;
}
if (bot.entity.position.distanceTo(furnaceBlock.position) > 4) {
await goToNearestBlock(bot, 'furnace', 4, 32);
}
console.log('clearing furnace...');
const furnace = await bot.openFurnace(furnaceBlock);