mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-27 09:23:03 +02:00
fix: update package
This commit is contained in:
parent
430ae24d20
commit
359592825a
2 changed files with 2 additions and 76 deletions
|
@ -25,7 +25,7 @@
|
|||
"socket.io": "^4.7.2",
|
||||
"socket.io-client": "^4.7.2",
|
||||
"express": "^4.18.2",
|
||||
"node-canvas-webgl": "^0.2.6",
|
||||
"node-canvas-webgl": "PrismarineJS/node-canvas-webgl",
|
||||
"three": "^0.128.0"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -1353,77 +1353,3 @@ export async function activateNearestBlock(bot, type) {
|
|||
log(bot, `Activated ${type} at x:${block.position.x.toFixed(1)}, y:${block.position.y.toFixed(1)}, z:${block.position.z.toFixed(1)}.`);
|
||||
return true;
|
||||
}
|
||||
|
||||
// export async function lookAtPlayer(agent, bot, player_name, direction) {
|
||||
// /**
|
||||
// * Look at a player or look in the same direction as the player
|
||||
// * @param {MinecraftBot} bot reference to the minecraft bot
|
||||
// * @param {string} player_name name of the target player
|
||||
// * @param {string} direction 'at' to look at player, 'with' to look in same direction
|
||||
// * @returns {Promise<boolean>} whether the look action was successful
|
||||
// * @example
|
||||
// * await skills.lookAtPlayer(bot, "player1", "at");
|
||||
// * await skills.lookAtPlayer(bot, "player1", "with");
|
||||
// **/
|
||||
|
||||
// const player = bot.players[player_name]?.entity;
|
||||
// if (!player) {
|
||||
// log(bot, `Could not find player ${player_name}`);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// let filename;
|
||||
// if (direction === 'with') {
|
||||
// // Copy player's view direction
|
||||
// await bot.look(player.yaw, player.pitch);
|
||||
// const camera = new Camera(bot);
|
||||
// await new Promise(resolve => setTimeout(resolve, 500));
|
||||
// log(bot, `Looking in the same direction as ${player_name}`);
|
||||
|
||||
// filename = await camera.capture();
|
||||
// console.log(player.yaw, player.pitch);
|
||||
// // log(bot, `Screenshot saved: bots/${bot.username}/screenshots/${filename}.jpg`);
|
||||
|
||||
// } else {
|
||||
// // Look at player's position
|
||||
// await bot.lookAt(new Vec3(player.position.x, player.position.y + player.height, player.position.z));
|
||||
// const camera = new Camera(bot);
|
||||
// await new Promise(resolve => setTimeout(resolve, 500));
|
||||
// log(bot, `Looking at player ${player_name}`);
|
||||
|
||||
// filename = await camera.capture();
|
||||
// // log(bot, `Screenshot saved: bots/${bot.username}/screenshots/${filename}.jpg`);
|
||||
// // log(bot, `Target coordinates: x:${player.position.x}, y:${player.position.y}, z:${player.position.z}`);
|
||||
// }
|
||||
|
||||
// try {
|
||||
// const imageBuffer = fs.readFileSync(`bots/${bot.username}/screenshots/${filename}.jpg`);
|
||||
// const messages = agent.history.getHistory();
|
||||
// let res = await agent.prompter.promptImageConvo(messages, imageBuffer);
|
||||
// log(bot, res);
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
// log(bot, `Error analyzing image: ${error.message}`);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// export async function lookAtPosition(agent, bot, x, y, z) {
|
||||
// await bot.lookAt(new Vec3(x, y + 2, z));
|
||||
// const camera = new Camera(bot);
|
||||
// await new Promise(resolve => setTimeout(resolve, 500));
|
||||
// log(bot, `Looking at coordinate ${x, y, z}`);
|
||||
|
||||
// let filename = await camera.capture();
|
||||
|
||||
// try {
|
||||
// const imageBuffer = fs.readFileSync(`bots/${bot.username}/screenshots/${filename}.jpg`);
|
||||
// const messages = agent.history.getHistory();
|
||||
// let res = await agent.prompter.promptImageConvo(messages, imageBuffer);
|
||||
// log(bot, res);
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
// log(bot, `Error analyzing image: ${error.message}`);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
|
Loading…
Add table
Reference in a new issue