diff --git a/computer/13/garbage/make_belts.lua b/computer/13/garbage/make_belts.lua deleted file mode 100644 index 83024e1..0000000 --- a/computer/13/garbage/make_belts.lua +++ /dev/null @@ -1,60 +0,0 @@ -require("recipes") -require("pathfinding") -iv = require("inventory") - - --- belt recipe -getItems("minecraft:kelp", 4) -getItems("minecraft:charcoal", 1) -getItems("techreborn:rubber", 3) --- furnace -go_to(vector.new(1,0,0), "south") -selectItem("minecraft:charcoal") -iv.insertForward(2) -selectItem("minecraft:kelp") -iv.insertForward(1) - -sleep(40) -iv.takeForward(3) - -selectItem("minecraft:dried_kelp") - -for i = 1,3 do --- deployer -go_to(vector.new(2,0,0), "south") -iv.insertForwardDepot(1) -go_to(vector.new(2,1,0), "south") -selectItem("techreborn:rubber") -turtle.dropUp(1) -goDown() -sleep(1) -iv.takeForwardDepot() --- press -go_to(vector.new(-1,0,0), "south") -selectItem("minecraft:dried_kelp", true) -iv.insertForwardDepot(1) -sleep(1) -iv.takeForwardDepot() --- deployer 2 -selectItem("minecraft:dried_kelp", true) -print("selected partial belt") -go_to(vector.new(2,0,0), "south") -iv.insertForwardDepot(1) -go_to(vector.new(2,1,0), "south") -selectItem("minecraft:dried_kelp", false) -turtle.dropUp(1) -goDown() -sleep(1) -iv.takeForwardDepot() --- press 2 -selectItem("minecraft:dried_kelp", true) -go_to(vector.new(-1,0,0), "south") -iv.insertForwardDepot(1) -sleep(1) -iv.takeForwardDepot() - -selectItem("minecraft:dried_kelp", true) - -end - -go_to(vector.new(0,0,0), "south") diff --git a/computer/13/machines.lua b/computer/13/machines.lua index 478c137..9b926cb 100644 --- a/computer/13/machines.lua +++ b/computer/13/machines.lua @@ -1,8 +1,23 @@ require("inventory") require("pathfinding") +press_pos = vector.new(1,0,0) +deployer_pos = vector.new(2,0,0) +furnace_pos = vector.new(3,0,0) +mill_pos = vector.new(4,0,0) +mixer_pos = vector.new(-1,0,0) +compactor_pos = vector.new(-2,0,0) +spout_pos = vector.new(-3,0,0) +melter_pos = vector.new(-4,1,-3) +casting_table_pos = vector.new(-3,0,-3) + +-- fluid_tanks = { +-- water = vector.new(0,0,-1), +-- lava = vector.new(0,0,-1) +-- } + function mill(extra_items) - go_to(vector.new(-4,0,0),"south") + goTo(mill_pos,"south") item_count = 0 if turtle.getItemCount() ~= 0 then item_count = 1 @@ -23,7 +38,7 @@ function mill(extra_items) end function deploy(extra_items, nbt) -- extra_items should only be one item - go_to(vector.new(2,0,0), "south") + goTo(deployer_pos, "south") insertDepot(1) goUp() goUp() @@ -43,7 +58,7 @@ function deploy_tool(extra_items) turtle.suckUp() end function furnace(extra_items) - go_to(vector.new(1,0,0), "south") + goTo(furnace_pos, "south") item_count = 0 if turtle.getItemCount() ~= 0 then item_count = 1 @@ -60,14 +75,17 @@ function furnace(extra_items) takeForward(3) end function press(_) - go_to(vector.new(-1,0,0), "south") + goTo(press_pos, "south") insertDepot(1) sleep(1) takeDepot() end -function compact(extra_items) end +function compact(extra_items) + printError("unimplemented :3") + fail() +end function mix(extra_items) - go_to(vector.new(-3,0,0), "south") + goTo(mixer_pos, "south") insertForward(1, 1) for _, item in pairs(extra_items) do selectItem(item.name) diff --git a/computer/13/main.lua b/computer/13/main.lua index 600a21b..eaf9080 100644 --- a/computer/13/main.lua +++ b/computer/13/main.lua @@ -10,5 +10,4 @@ keep_stocked = { flint = 10 } -go_to(vector.new(0,0,0), "south") -recipes = load_recipes() \ No newline at end of file +goHome() diff --git a/computer/13/pathfinding.lua b/computer/13/pathfinding.lua index d86096d..3bd19f4 100644 --- a/computer/13/pathfinding.lua +++ b/computer/13/pathfinding.lua @@ -88,7 +88,7 @@ function stepTo(target) end end -function go_to(target, face) +function goTo(target, face) while target ~= _G.pos do stepTo(target) end @@ -103,3 +103,7 @@ function go_to(target, face) end end end + +function goHome() + goTo(vector.new(0,0,0), "south") +end \ No newline at end of file diff --git a/computer/13/recipes.txt b/computer/13/recipes.txt index 7172e6a..3654a1e 100644 --- a/computer/13/recipes.txt +++ b/computer/13/recipes.txt @@ -167,4 +167,16 @@ craft andesite_alloy andesite_alloy andesite_alloy andesite_alloy polished_rose_ glass_pane steps: -craft glass glass glass glass glass glass \ No newline at end of file +craft glass glass glass glass glass glass + +copper_casing +base andesite_casing +intermediate incomplete_copper_casing +repeat 3 +steps: +deploy rubber +deploy copper_sheet + +kelp +steps: +mix water kelp bone_meal:2 diff --git a/computer/13/work.lua b/computer/13/work.lua index 46459bf..ff103ac 100644 --- a/computer/13/work.lua +++ b/computer/13/work.lua @@ -10,8 +10,7 @@ keep_stocked = { flint = 10 } -go_to(vector.new(0,0,0), "south") -recipes = load_recipes() +goHome() print("known recipes:\n") for k,_ in pairs(recipes) do @@ -57,7 +56,7 @@ function doRecipe(recipe) -- read() end end - go_to(vector.new(0,0,0), "south") + goHome() for i = 1, 16 do if turtle.getItemCount(i) ~= 0 then turtle.select(i)