mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-03-28 14:56:24 +01:00
fix syntax error, var->let, remove examples
This commit is contained in:
parent
b27b282d5a
commit
9c675c51bc
4 changed files with 11 additions and 23 deletions
|
@ -200,18 +200,6 @@
|
||||||
[
|
[
|
||||||
{"role": "system", "content": "You are self-prompting with the goal: 'Build a house'. Respond:"},
|
{"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": "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?"}
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -201,18 +201,18 @@ export const queryList = [
|
||||||
const curr_inventory = world.getInventoryCounts(bot);
|
const curr_inventory = world.getInventoryCounts(bot);
|
||||||
const target_item = targetItem;
|
const target_item = targetItem;
|
||||||
let existingCount = curr_inventory[target_item] || 0;
|
let existingCount = curr_inventory[target_item] || 0;
|
||||||
var prefixMessage = '';
|
let prefixMessage = '';
|
||||||
if (existingCount > 0) {
|
if (existingCount > 0) {
|
||||||
curr_inventory[target_item] -= existingCount;
|
curr_inventory[target_item] -= existingCount;
|
||||||
prefixMessage = `You already have ${existingCount} ${target_item} in your inventory. If you need to craft more,\n`;
|
prefixMessage = `You already have ${existingCount} ${target_item} in your inventory. If you need to craft more,\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate crafting plan
|
// Generate crafting plan
|
||||||
var craftingPlan = mc.getDetailedCraftingPlan(target_item, quantity, curr_inventory);
|
let craftingPlan = mc.getDetailedCraftingPlan(target_item, quantity, curr_inventory);
|
||||||
craftingPlan = prefixMessage + craftingPlan;
|
craftingPlan = prefixMessage + craftingPlan;
|
||||||
console.log('\n\n\n\n\n\n\n\n\n\n\n');
|
|
||||||
console.log(craftingPlan);
|
console.log(craftingPlan);
|
||||||
return pad(craftingPlan);
|
return pad(craftingPlan);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '!help',
|
name: '!help',
|
||||||
|
|
|
@ -109,11 +109,11 @@ export class Task {
|
||||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||||
|
|
||||||
if (this.data.agent_count > 1) {
|
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);
|
console.log("Initial inventory:", initial_inventory);
|
||||||
} else if (this.data) {
|
} else if (this.data) {
|
||||||
console.log("Initial inventory:", this.data.initial_inventory);
|
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) {
|
if ("initial_inventory" in this.data) {
|
||||||
|
|
12
viewer.html
12
viewer.html
|
@ -26,9 +26,9 @@
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
function updateLayout() {
|
function updateLayout() {
|
||||||
var width = window.innerWidth;
|
let width = window.innerWidth;
|
||||||
var height = window.innerHeight;
|
let height = window.innerHeight;
|
||||||
var iframes = document.querySelectorAll('.iframe-wrapper');
|
let iframes = document.querySelectorAll('.iframe-wrapper');
|
||||||
if (width > height) {
|
if (width > height) {
|
||||||
iframes.forEach(function(iframe) {
|
iframes.forEach(function(iframe) {
|
||||||
iframe.style.width = '50%';
|
iframe.style.width = '50%';
|
||||||
|
@ -43,10 +43,10 @@
|
||||||
}
|
}
|
||||||
window.addEventListener('resize', updateLayout);
|
window.addEventListener('resize', updateLayout);
|
||||||
window.addEventListener('load', updateLayout);
|
window.addEventListener('load', updateLayout);
|
||||||
var iframes = document.querySelectorAll('.iframe-wrapper');
|
let iframes = document.querySelectorAll('.iframe-wrapper');
|
||||||
iframes.forEach(function(iframe) {
|
iframes.forEach(function(iframe) {
|
||||||
var port = iframe.getAttribute('data-port');
|
let port = iframe.getAttribute('data-port');
|
||||||
var loaded = false;
|
let loaded = false;
|
||||||
function checkServer() {
|
function checkServer() {
|
||||||
fetch('http://localhost:' + port, { method: 'HEAD' })
|
fetch('http://localhost:' + port, { method: 'HEAD' })
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue