From a9b1d13f7f03de23c58b3c8a621c0827e7c52612 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sat, 26 Oct 2024 17:13:08 -0500 Subject: [PATCH 1/4] mostly fixed infinite jump bug --- patches/mineflayer-pathfinder+2.4.5.patch | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/patches/mineflayer-pathfinder+2.4.5.patch b/patches/mineflayer-pathfinder+2.4.5.patch index 4c8dc93..6906371 100644 --- a/patches/mineflayer-pathfinder+2.4.5.patch +++ b/patches/mineflayer-pathfinder+2.4.5.patch @@ -1,17 +1,16 @@ diff --git a/node_modules/mineflayer-pathfinder/index.js b/node_modules/mineflayer-pathfinder/index.js -index b38bd30..cfaa677 100644 +index b38bd30..bf16a63 100644 --- a/node_modules/mineflayer-pathfinder/index.js +++ b/node_modules/mineflayer-pathfinder/index.js -@@ -541,7 +541,7 @@ function inject (bot) { - let canPlace = true - if (placingBlock.jump) { - bot.setControlState('jump', true) -- canPlace = placingBlock.y + 1 < bot.entity.position.y -+ canPlace = placingBlock.y + 1.8 < bot.entity.position.y - } - if (canPlace) { - if (!lockEquipItem.tryAcquire()) return -@@ -557,6 +557,7 @@ function inject (bot) { +@@ -550,6 +550,7 @@ function inject (bot) { + lockEquipItem.release() + const refBlock = bot.blockAt(new Vec3(placingBlock.x, placingBlock.y, placingBlock.z), false) + if (!lockPlaceBlock.tryAcquire()) return ++ bot.world.setBlockStateId(refBlock.position.offset(placingBlock.dx, placingBlock.dy, placingBlock.dz), 1) + if (interactableBlocks.includes(refBlock.name)) { + bot.setControlState('sneak', true) + } +@@ -557,6 +558,7 @@ function inject (bot) { .then(function () { // Dont release Sneak if the block placement was not successful bot.setControlState('sneak', false) From a598d729866f9b0618198d9c65b752d5f5f36e9f Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sat, 26 Oct 2024 17:13:51 -0500 Subject: [PATCH 2/4] add unstuck mode to profiles --- andy.json | 1 + profiles/andy_npc.json | 1 + profiles/claude.json | 1 + profiles/gemini.json | 1 + profiles/gpt.json | 1 + profiles/llama.json | 1 + 6 files changed, 6 insertions(+) diff --git a/andy.json b/andy.json index 5482f45..adc5bd8 100644 --- a/andy.json +++ b/andy.json @@ -11,6 +11,7 @@ "modes": { "self_preservation": true, + "unstuck": true, "cowardice": true, "self_defense": true, "hunting": true, diff --git a/profiles/andy_npc.json b/profiles/andy_npc.json index 3eff4ae..8134c5e 100644 --- a/profiles/andy_npc.json +++ b/profiles/andy_npc.json @@ -13,6 +13,7 @@ "modes": { "self_preservation": true, + "unstuck": true, "cowardice": true, "self_defense": true, "hunting": true, diff --git a/profiles/claude.json b/profiles/claude.json index 20a06c5..415eda9 100644 --- a/profiles/claude.json +++ b/profiles/claude.json @@ -16,6 +16,7 @@ "modes": { "self_preservation": true, + "unstuck": true, "cowardice": false, "self_defense": true, "hunting": true, diff --git a/profiles/gemini.json b/profiles/gemini.json index 33f4918..bb354d2 100644 --- a/profiles/gemini.json +++ b/profiles/gemini.json @@ -13,6 +13,7 @@ "modes": { "self_preservation": true, + "unstuck": true, "cowardice": false, "self_defense": true, "hunting": true, diff --git a/profiles/gpt.json b/profiles/gpt.json index 271c368..7d1120d 100644 --- a/profiles/gpt.json +++ b/profiles/gpt.json @@ -11,6 +11,7 @@ "modes": { "self_preservation": true, + "unstuck": true, "cowardice": false, "self_defense": true, "hunting": true, diff --git a/profiles/llama.json b/profiles/llama.json index 86d13f6..b8620d9 100644 --- a/profiles/llama.json +++ b/profiles/llama.json @@ -15,6 +15,7 @@ "modes": { "self_preservation": true, + "unstuck": true, "cowardice": false, "self_defense": true, "hunting": true, From 583c9f8851c24313161e5f194cdab0984e190a71 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sat, 26 Oct 2024 17:14:34 -0500 Subject: [PATCH 3/4] fixed regex catastrophic backtracking for nested parens --- src/agent/commands/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/commands/index.js b/src/agent/commands/index.js index 622808e..13d7201 100644 --- a/src/agent/commands/index.js +++ b/src/agent/commands/index.js @@ -14,7 +14,7 @@ export function getCommand(name) { return commandMap[name]; } -const commandRegex = /!(\w+)(?:\(((?:[^)(]+|'[^']*'|"[^"]*")*)\))?/ +const commandRegex = /!(\w+)(?:\(([\s\S]*)\))?/ const argRegex = /(?:"[^"]*"|'[^']*'|[^,])+/g; export function containsCommand(message) { From cfd13d4cd14a4d5fe1c78f954b6049ffc8b86c3e Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sun, 27 Oct 2024 00:09:46 -0500 Subject: [PATCH 4/4] added unstuck to freeguy --- profiles/freeguy.json | 1 + 1 file changed, 1 insertion(+) diff --git a/profiles/freeguy.json b/profiles/freeguy.json index 62b50ae..0df24a5 100644 --- a/profiles/freeguy.json +++ b/profiles/freeguy.json @@ -13,6 +13,7 @@ "modes": { "self_preservation": true, + "unstuck": true, "cowardice": true, "self_defense": true, "hunting": true,