From 76787d4283d5639eff2e6d14f2d3c8fd16bc3a80 Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Sat, 17 Jan 2026 17:05:01 -0500 Subject: [PATCH] fix: remove syntax errors --- compacting-storage.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/compacting-storage.lua b/compacting-storage.lua index 8fdd2dd..1fa12b7 100644 --- a/compacting-storage.lua +++ b/compacting-storage.lua @@ -56,19 +56,19 @@ local getName = { nugget = function (item_type) return ("%s:%s_nugget"):format( ITEM_TYPES[item_type].nugget, - item_type, + item_type ) end, ingot = function (item_type) return ("%s:%s_ingot"):format( ITEM_TYPES[item_type].ingot, - item_type, + item_type ) end, block = function (item_type) return ("%s:%s_block"):format( ITEM_TYPES[item_type].block, - item_type, + item_type ) end, } @@ -90,10 +90,12 @@ function craft (requester, item_type, conversion_type) count = NUGGET_RATIO address = COMPACTING_ADDR else - count = BLOCK_RATIO end + count = BLOCK_RATIO address = UNPACKING_ADDR end - requester.setRequest({ name, count }) + requester.setAddress(address) + requester.setRequest({ name = name, count = count }) + requester.request() end function craft_multiple (requester, item_type, conversion_type, count) @@ -110,10 +112,10 @@ function execute_crafts (requester, item_type, crafts) local num_crafts = crafts.nugget if num_crafts > 0 then print(("Crafting %s nuggets"):format(item_type)) - craft_multiple(item_type, 4, num_crafts) + craft_multiple(requester, item_type, 4, num_crafts) elseif num_crafts < 0 then print(("Crafting %s ingots"):format(item_type)) - craft_multiple(item_type, 1, -num_crafts) + craft_multiple(requester, item_type, 1, -num_crafts) end num_crafts = crafts.block if num_crafts > 0 then @@ -121,7 +123,7 @@ function execute_crafts (requester, item_type, crafts) craft_multiple(requester, item_type, 2, num_crafts) elseif num_crafts < 0 then print(("Crafting %s ingots"):format(item_type)) - craft_multiple(item_type, 3, -num_crafts) + craft_multiple(requester, item_type, 3, -num_crafts) end end @@ -141,15 +143,13 @@ function sum_items (inv_f) end function dist_to_num (dist) - return dist.nugget + dist.ingot * INGOTS + dist.block * BLOCKS + return dist.nugget + (dist.ingot * INGOTS) + (dist.block * BLOCKS) end function get_dist (item_type, items) - -- TODO change plurals to singulars to match mc local dist = { nugget = 0, ingot = 0, block = 0 } for item, count in pairs(items) do local type, form = item:match":(%l-)_(%l*)" - form = string.format("%ss", form) if type == item_type and dist[form] ~= nil then dist[form] = dist[form] + count end