This commit is contained in:
Crispy 2025-06-22 00:08:46 +02:00
parent f8fd2513c8
commit 491112768c
27 changed files with 1095 additions and 3537 deletions

View file

@ -162,8 +162,8 @@ function alloy(parts, product)
pumpToDevices(true)
goTo(mixer_pos, "south")
-- wait for 1B or tank content is in the mixer
expected_amount = math.min(getFluidAmount(fluid.name), 1000)
print("waiting for", expected_amount, fluid.name, "in mixer")
expected_amount = math.min(getFluidAmount(fluid.name), 81000)
print("waiting for", droplet2string(expected_amount), fluid.name, "in mixer")
while getFluidAmountInTanks(fluid.name, pFront("tanks")) < expected_amount do
sleep(0.1)
end
@ -191,13 +191,13 @@ function alloy(parts, product)
end
pumpToTanks(false)
if stripModname(fluid.name) == product then
fluidInvAdd(product, fluid.amount)
fluidInvAdd(product, mb2droplet(fluid.amount))
created_amount = fluid.amount
end
end
end
for _, fluid in pairs(parts) do
fluidInvAdd(fluid.name, -created_amount)
fluidInvAdd(fluid.name, -mb2droplet(created_amount))
end
end
@ -226,7 +226,7 @@ function mix(extra_items, product, yield)
end
end
if #fluids > 0 then
print("mixing with fluids", fluids[1])
print("mixing with fluid", fluids[1].name)
selectFluidDevice("mixer")
connectTank(fluids[1].name)
pumpToDevices(true)
@ -335,8 +335,8 @@ function cast_ingot(source, product, yield)
until done_filling
pumpToDevices(false)
local fluid_in_melter = melter_tank.amount
local ingot_count = math.floor(fluid_in_melter / 111)
local leftover = fluid_in_melter - ingot_count * 111.11
local ingot_count = math.floor(fluid_in_melter / 9000)
local leftover = fluid_in_melter - ingot_count * 9000
print("expecting", ingot_count, "ingots")
goTo(casting_pos, "west")
for i = 1, ingot_count do
@ -356,7 +356,7 @@ function cast_ingot(source, product, yield)
sleep(5)
pumpToTanks(false)
end
fluidInvAdd(fluid.name, -(ingot_count * 111))
fluidInvAdd(fluid.name, -(ingot_count * 9000))
end
function rolling_mill(extra_items)