fix syntax error, var->let, remove examples

This commit is contained in:
MaxRobinsonTheGreat 2025-02-04 16:26:00 -06:00
parent b27b282d5a
commit 9c675c51bc
4 changed files with 11 additions and 23 deletions

View file

@ -200,18 +200,6 @@
[
{"role": "system", "content": "You are self-prompting with the goal: 'Build a house'. Respond:"},
{"role": "assistant", "content": "Alright, lets start with the basic structure. !newAction(\"Build an 8x8 base for the house.\")"}
],
[
{"role": "user", "content": "trex56: Lets make a wooden pickaxe together"},
{"role": "assistant", "content": "Sure, let me check how to make a wooden pickaxe !getCraftingPlan(\"wooden_pickaxe\",1)"},
{"role": "system", "content": "You are missing the following items:\n- 2 oak_log\n\nOnce you have these items, here's your crafting plan:\n\nCraft 1 oak_log -> 4 oak_planks\nCraft 1 oak_log -> 4 oak_planks\nCraft 2 oak_planks -> 4 stick\nCraft 3 oak_planks + 2 stick -> 1 wooden_pickaxe"},
{"role": "assistant", "content": "I need 2 oak logs to make a wooden pickaxe. Do you have any?"}
],
[
{"role": "user", "content": "terrance: (FROM OTHER BOT) I want you to craft 5 chains"},
{"role": "assistant", "content": "Sure, first let me check how to build a chain, !getCraftingPlan(\"chain\",5)"},
{"role": "system", "content": "You are missing the following items:\n- 7 iron_ingot\n\nOnce you have these items, here's your crafting plan:\n\nCraft 2 iron_ingot -> 18 iron_nugget\nCraft 10 iron_nugget + 5 iron_ingot -> 5 chain"},
{"role": "assistant", "content": "Seems like I need 7 iron_ingots for 5 chains. Do you have any?"}
]
],

View file

@ -201,18 +201,18 @@ export const queryList = [
const curr_inventory = world.getInventoryCounts(bot);
const target_item = targetItem;
let existingCount = curr_inventory[target_item] || 0;
var prefixMessage = '';
let prefixMessage = '';
if (existingCount > 0) {
curr_inventory[target_item] -= existingCount;
prefixMessage = `You already have ${existingCount} ${target_item} in your inventory. If you need to craft more,\n`;
}
// Generate crafting plan
var craftingPlan = mc.getDetailedCraftingPlan(target_item, quantity, curr_inventory);
let craftingPlan = mc.getDetailedCraftingPlan(target_item, quantity, curr_inventory);
craftingPlan = prefixMessage + craftingPlan;
console.log('\n\n\n\n\n\n\n\n\n\n\n');
console.log(craftingPlan);
return pad(craftingPlan);
},
},
{
name: '!help',

View file

@ -109,11 +109,11 @@ export class Task {
await new Promise((resolve) => setTimeout(resolve, 500));
if (this.data.agent_count > 1) {
var initial_inventory = this.data.initial_inventory[this.agent.count_id.toString()];
let initial_inventory = this.data.initial_inventory[this.agent.count_id.toString()];
console.log("Initial inventory:", initial_inventory);
} else if (this.data) {
console.log("Initial inventory:", this.data.initial_inventory);
var initial_inventory = this.data.initial_inventory;
let initial_inventory = this.data.initial_inventory;
}
if ("initial_inventory" in this.data) {

View file

@ -26,9 +26,9 @@
</div>
<script>
function updateLayout() {
var width = window.innerWidth;
var height = window.innerHeight;
var iframes = document.querySelectorAll('.iframe-wrapper');
let width = window.innerWidth;
let height = window.innerHeight;
let iframes = document.querySelectorAll('.iframe-wrapper');
if (width > height) {
iframes.forEach(function(iframe) {
iframe.style.width = '50%';
@ -43,10 +43,10 @@
}
window.addEventListener('resize', updateLayout);
window.addEventListener('load', updateLayout);
var iframes = document.querySelectorAll('.iframe-wrapper');
let iframes = document.querySelectorAll('.iframe-wrapper');
iframes.forEach(function(iframe) {
var port = iframe.getAttribute('data-port');
var loaded = false;
let port = iframe.getAttribute('data-port');
let loaded = false;
function checkServer() {
fetch('http://localhost:' + port, { method: 'HEAD' })
.then(function(response) {