diff --git a/apps/chestManager.lua b/apps/chestManager.lua index cf6f973..4647f61 100644 --- a/apps/chestManager.lua +++ b/apps/chestManager.lua @@ -509,6 +509,15 @@ local function restock() end end +local function eject(item, qty) + if _G.turtle then + local s, m = pcall(function() + inventoryAdapter:provide(item, qty) + _G.turtle.emptyInventory() + end) + end +end + local function jobMonitor() local mon = Peripheral.lookup(config.monitor) @@ -1211,7 +1220,7 @@ local function learnRecipe(page) listingPage:refresh() listingPage.grid:draw() - inventoryAdapter:eject(recipe, recipe.count, 'front') + eject(recipe, recipe.count) return true end else @@ -1437,15 +1446,6 @@ Event.onInterval(5, function() end end - local function eject(item, qty) - if _G.turtle then - local s, m = pcall(function() - inventoryAdapter:provide(item, qty) - _G.turtle.emptyInventory() - end) - end - end - for _,key in pairs(Util.keys(demandCrafting)) do local item = demandCrafting[key] if item.crafted then