diff --git a/biofuel-manager.lua b/biofuel-manager.lua index ff08bfd..0f4b2bb 100644 --- a/biofuel-manager.lua +++ b/biofuel-manager.lua @@ -5,9 +5,7 @@ local STORAGE = "" local OIL_TANK = "" local FUEL_TANK = "" -local OIL_SETPOINT = 64000 -local BIOMASS_SETPOINT = 4 * 64 -local BIOFUEL_SETPOINT = 128000 +local FACTORY_ADDRESS = "" local SPEEDOMETER = "" local SUBNET_TICKER = "" @@ -124,11 +122,7 @@ function getOrders () local orders = {} -- Oil local oil_amt = table.remove(peripheral.call(OIL_TANK, "tanks")) - if oil_amt == nil then - oil_amt = 0 - else - oil_amt = oil_amt.amount - end + if oil_amt == nil then oil_amt = 0 end local oil_needed = OIL_SETPOINT - oil_amt if oil_needed > 0 then orders.oil = oil_needed end -- Biomass @@ -140,11 +134,7 @@ function getOrders () -- Biofuel -- TODO use up excess material? local biofuel_amt = table.remove(peripheral.call(FUEL_TANK, "tanks")) - if biofuel_amt == nil then - biofuel_amt = 0 - else - biofuel_amt = biofuel_amt.amount - end + if biofuel_amt == nil then biofuel_amt = 0 end local biofuel_needed = BIOFUEL_SETPOINT - biofuel_amt if biofuel_needed > 0 then orders.biofuel = biofuel_needed end return orders