Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.wrap("top") -- or the side it's on, e.g., "top", "left", etc.
- local machine = peripheral.wrap("bottom") -- or the side it's on, e.g., "back", "right", etc.
- local numberOfMachine = 5
- local processingTimeInTick = numberOfMachine * 8 * 2
- local processingTimeInSeconds = processingTimeInTick / 20 -- Convert ticks to seconds
- local rechargeTimeInSeconds = 1 -- Time to recharge the machine
- local totalProcessingTimeInSeconds = processingTimeInSeconds + rechargeTimeInSeconds
- -- Main loop
- machine.pushItems(peripheral.getName(chest), 1)
- while true do
- local items = chest.list()
- for slot, item in pairs(items) do
- local details = chest.getItemDetail(slot, true)
- if details and details.nbt and string.sub(details.nbt, 1, 8) == "866815d7" then
- chest.pushItems(peripheral.getName(machine), slot)
- sleep(totalProcessingTimeInSeconds) -- Wait for the machine to process the item
- machine.pushItems(peripheral.getName(chest), 1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement