fix: remove syntax errors

This commit is contained in:
Emerson Rosen-Jones 2026-01-02 22:40:12 -05:00
parent efb7b6f6d1
commit 685a3d47e0

View file

@ -61,7 +61,7 @@ function createModes (items)
return result
end
function updateModes (current_modes)
function updateModes (ticker, current_modes)
local lower_lim, upper_lim
local limits = {}
for item, _ in pairs(current_modes) do
@ -154,7 +154,7 @@ function getNumCraftable (recipe, current_stock)
for _, ingredient in ipairs(recipe) do
item, count = ingredient[1], ingredient[2]
if current_stock[item] == nil then return 0 end
local num = math.floor(current_stock[item] / count))
local num = math.floor(current_stock[item] / count)
if result == nil then
result = num
else
@ -194,7 +194,7 @@ end
function run (ticker, export_storage, current_modes)
cycleItems(ticker)
updateModes(current_modes)
updateModes(ticker, current_modes)
local export_amounts = getAmounts(export_storage.list)
local stock_amounts = getAmounts(ticker.stock)
for item, mode in pairs(current_modes) do
@ -205,7 +205,9 @@ function run (ticker, export_storage, current_modes)
local count = getNumCraftable(recipe, stock_amounts)
craftRecipe(ticker, recipe, count)
elseif mode[1] == "export" then
local amt_needed = export_amounts[item]
local export_amt = export_amounts[item]
if export_amt == nil then export_amt = 0 end
local amt_needed = KEEP_STOCKED[item] - export_amt
local amt = math.min(amt_needed, mode[2])
export(ticker, item, amt)
end