mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-07-01 06:05:19 +02:00
commit
e8e3cb7116
6 changed files with 32 additions and 25 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "claude",
|
||||
|
||||
"model": "claude-3-5-sonnet-20240620",
|
||||
"model": "claude-3-5-sonnet-latest",
|
||||
|
||||
"embedding": "openai",
|
||||
|
||||
|
@ -15,14 +15,14 @@
|
|||
|
||||
|
||||
"modes": {
|
||||
"self_preservation": false,
|
||||
"self_preservation": true,
|
||||
"cowardice": false,
|
||||
"self_defense": false,
|
||||
"hunting": false,
|
||||
"self_defense": true,
|
||||
"hunting": true,
|
||||
"item_collecting": true,
|
||||
"torch_placing": false,
|
||||
"torch_placing": true,
|
||||
"idle_staring": true,
|
||||
"cheat": true
|
||||
"cheat": false
|
||||
},
|
||||
|
||||
"conversation_examples": [
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
"saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: ",
|
||||
|
||||
"modes": {
|
||||
"self_preservation": false,
|
||||
"self_preservation": true,
|
||||
"cowardice": false,
|
||||
"self_defense": false,
|
||||
"hunting": false,
|
||||
"self_defense": true,
|
||||
"hunting": true,
|
||||
"item_collecting": true,
|
||||
"torch_placing": false,
|
||||
"torch_placing": true,
|
||||
"idle_staring": true,
|
||||
"cheat": true
|
||||
"cheat": false
|
||||
},
|
||||
|
||||
"conversation_examples": [
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
"saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: ",
|
||||
|
||||
"modes": {
|
||||
"self_preservation": false,
|
||||
"self_preservation": true,
|
||||
"cowardice": false,
|
||||
"self_defense": false,
|
||||
"hunting": false,
|
||||
"self_defense": true,
|
||||
"hunting": true,
|
||||
"item_collecting": true,
|
||||
"torch_placing": false,
|
||||
"torch_placing": true,
|
||||
"idle_staring": true,
|
||||
"cheat": true
|
||||
"cheat": false
|
||||
},
|
||||
|
||||
"conversation_examples": [
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
"saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: ",
|
||||
|
||||
"modes": {
|
||||
"self_preservation": false,
|
||||
"self_preservation": true,
|
||||
"cowardice": false,
|
||||
"self_defense": false,
|
||||
"hunting": false,
|
||||
"self_defense": true,
|
||||
"hunting": true,
|
||||
"item_collecting": true,
|
||||
"torch_placing": false,
|
||||
"torch_placing": true,
|
||||
"idle_staring": true,
|
||||
"cheat": true
|
||||
"cheat": false
|
||||
},
|
||||
|
||||
"conversation_examples": [
|
||||
|
|
|
@ -306,8 +306,9 @@ export const actionsList = [
|
|||
{
|
||||
name: '!stay',
|
||||
description: 'Stay in the current location no matter what. Pauses all modes.',
|
||||
perform: wrapExecution(async (agent) => {
|
||||
await skills.stay(agent.bot);
|
||||
params: {'type': { type: 'int', description: 'The number of seconds to stay. -1 for forever.', domain: [-1, Number.MAX_SAFE_INTEGER] }},
|
||||
perform: wrapExecution(async (agent, seconds) => {
|
||||
await skills.stay(agent.bot, seconds);
|
||||
})
|
||||
},
|
||||
{
|
||||
|
|
|
@ -716,6 +716,9 @@ export async function equip(bot, itemName) {
|
|||
else if (itemName.includes('chestplate') || itemName.includes('elytra')) {
|
||||
await bot.equip(item, 'torso');
|
||||
}
|
||||
else if (itemName.includes('shield')) {
|
||||
await bot.equip(item, 'off-hand');
|
||||
}
|
||||
else {
|
||||
await bot.equip(item, 'hand');
|
||||
}
|
||||
|
@ -1082,10 +1085,11 @@ export async function avoidEnemies(bot, distance=16) {
|
|||
return true;
|
||||
}
|
||||
|
||||
export async function stay(bot) {
|
||||
export async function stay(bot, seconds=30) {
|
||||
/**
|
||||
* Stay in the current position until interrupted. Disables all modes.
|
||||
* @param {MinecraftBot} bot, reference to the minecraft bot.
|
||||
* @param {number} seconds, the number of seconds to stay. Defaults to 30. -1 for indefinite.
|
||||
* @returns {Promise<boolean>} true if the bot stayed, false otherwise.
|
||||
* @example
|
||||
* await skills.stay(bot);
|
||||
|
@ -1097,9 +1101,11 @@ export async function stay(bot) {
|
|||
bot.modes.pause('hunting');
|
||||
bot.modes.pause('torch_placing');
|
||||
bot.modes.pause('item_collecting');
|
||||
while (!bot.interrupt_code) {
|
||||
let start = Date.now();
|
||||
while (!bot.interrupt_code && (seconds === -1 || Date.now() - start < seconds*1000)) {
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
}
|
||||
log(bot, `Stayed for ${(Date.now() - start)/1000} seconds.`);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue