From 038e6b185bc0d3f8c104b7f513bfa304cb1dcd64 Mon Sep 17 00:00:00 2001 From: kepler155c Date: Wed, 21 Feb 2018 09:34:22 -0500 Subject: [PATCH] 1.7.10 compatibility --- apps/Crafter.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/Crafter.lua b/apps/Crafter.lua index 6d29a66..4e4e0c7 100644 --- a/apps/Crafter.lua +++ b/apps/Crafter.lua @@ -183,21 +183,23 @@ end local function isMachineEmpty(machine, item) local side = turtle.getAction(machine.dir).side local methods = Peripheral.getMethods(side) - local list = { } + local list = { true } +debug(methods) if methods.getAllStacks then -- 1.7x list = Peripheral.call(side, 'getAllStacks', false) elseif methods.list then list = Peripheral.call(side, 'list') elseif methods.getProgress then - if Peripheral.call(side, 'getProgress') ~= 0 then - list = { true } + if Peripheral.call(side, 'getProgress') == 0 then + return true end else item.statusCode = STATUS_ERROR item.status = 'Unable to check empty status' + return end - +debug(list) if Util.empty(list) then return true end @@ -280,10 +282,8 @@ local function craftItem(ikey, item, items, machineStatus) item.status = 'failed to find machine' item.statusCode = STATUS_ERROR else - if machine.empty then - if not isMachineEmpty(machine, item) then - return - end + if machine.empty and not isMachineEmpty(machine, item) then + return end if machine.dir == 'up' then