Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
18
Code:
--declare all variables
--configuration
local configInscriber        = "tileinscriber_0"
local configTopChest        = "container_chest_0"
local configBottomChest        = "container_chest_1"
local sleepTime             = 5
--get all the peripherals
chests={}
--local chests['top']        = peripheral.wrap(configTopChest)
--local chests['Bottom']    = peripheral.wrap(configBottomChest)
local inscriber            = peripheral.wrap(configInscriber)

--tables
--crafting recipes
local crafting={}
crafting['printedSilicon']={'Inscriber Silicon Press',"Silicon"}
--list with all the items
local items={}

--functions
function craft(ingredients)
    local items={}
    local amount=0
    local errorMessage=nil
    inscriber.pushItem("DOWN", 4, 64)
    for key,value in pairs(items) do
        amount=itemToInscriber(key,value)
        if amount~=1 then
            clean()
            errorMessage="Not enough "..value.." stopping the crafting process"
            --break()
        end
    end
end

function itemToInscriber(item,slot)
    local where="DOWN"
    for chestKey, chest in pairs (chests) do
        local items =chest.getAllStacks(true)
        for key,value in pairs(items) do
            if value['name']==item then
                if chestKey=="bottom" then
                    where="UP"
                end
                return chest.pushItemIntoSLot(where,key,1,slot)
            end
        end
    end
    return false
end
--other variables
craft(crafting['printedSilicon'])

oh, it still doesn't work btw
 
  • Like
Reactions: xTordX

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
18 and I was a derp
forgot that the chests where commented out and forgot to change the local stuff >_>