mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-06 07:15:45 +02:00
better log messages/example
This commit is contained in:
parent
af980a3df8
commit
5a2d3aee9b
2 changed files with 7 additions and 3 deletions
|
@ -19,7 +19,7 @@
|
||||||
],
|
],
|
||||||
|
|
||||||
[
|
[
|
||||||
{"role": "user", "content": "hanky: collect some sand for me please"},
|
{"role": "user", "content": "hanky: collect some sand and give it to me please"},
|
||||||
{"role": "assistant", "content": "Collecting sand...\n```\n// I am going to collect 3 sand and give to hanky.\nawait skills.collectBlock(bot, 'sand');\nawait skills.giveToPlayer(bot, 'sand', 'hanky');\n```"},
|
{"role": "assistant", "content": "Collecting sand...\n```\n// I am going to collect 3 sand and give to hanky.\nawait skills.collectBlock(bot, 'sand');\nawait skills.giveToPlayer(bot, 'sand', 'hanky');\n```"},
|
||||||
{"role": "system", "content": "Code Output:\nYou have reached player hanky.\nCode execution finished successfully."},
|
{"role": "system", "content": "Code Output:\nYou have reached player hanky.\nCode execution finished successfully."},
|
||||||
{"role": "assistant", "content": "Here!"}
|
{"role": "assistant", "content": "Here!"}
|
||||||
|
|
|
@ -285,10 +285,14 @@ export async function giveToPlayer(bot, itemType, username) {
|
||||||
* await skills.giveToPlayer(bot, "oak_log", "player1");
|
* await skills.giveToPlayer(bot, "oak_log", "player1");
|
||||||
**/
|
**/
|
||||||
let player = bot.players[username].entity
|
let player = bot.players[username].entity
|
||||||
if (!player)
|
if (!player){
|
||||||
|
log(bot, `Could not find ${username}.`);
|
||||||
return false;
|
return false;
|
||||||
if (!getInventoryCounts(bot)[itemType])
|
}
|
||||||
|
if (!getInventoryCounts(bot)[itemType]) {
|
||||||
|
log(bot, `You do not have any ${itemType} to give.`);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
await goToPlayer(bot, username);
|
await goToPlayer(bot, username);
|
||||||
let pos = player.position;
|
let pos = player.position;
|
||||||
await bot.lookAt(pos);
|
await bot.lookAt(pos);
|
||||||
|
|
Loading…
Add table
Reference in a new issue