Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - --[[
 - I wrote this to test items coming from a vacuum hopper, if they fuzzy match the naming criterion, then
 - it assumes they are are broken ores, and then crafts as many as it can into a 2x2 grid, making gravel ore
 - It keeps up well on a simple system with four sieves and 4 activators per sieve, might be able to handle
 - larger volumes.
 - In my build I had 4 sieves surrounding an Iron chest, a vacuum hopper was placed on top of this chest
 - The crafty turtle was below it, and a chest was below the turtle, the top 10 lines or so should be all
 - you'd need to change to make it cater to your build
 - ]]
 - -- Broken Ores come from this chest
 - local chest = peripheral.wrap("top")
 - -- The turtle's direction in relation to chest.
 - local turtleDir = "down"
 - function dropItems()
 - -- rewrite this to drop slot 1 wherever
 - turtle.select(1)
 - turtle.dropDown()
 - end
 - --[[ Leave the rest alone, or break it.. or whatever.. ]]
 - function isBrokenOre(stack)
 - if stack == nil then
 - return false
 - end
 - local bstart,bend = stack.name:find("Broken")
 - local ostart,oend = stack.name:find("Ore")
 - if bstart == nil then
 - return false
 - end
 - if ostart == nil then
 - return false
 - end
 - return true
 - end
 - function fetchSlot(slot, qty)
 - chest.pushItem(turtleDir, slot, qty)
 - end
 - function makeGravel(slot, stack)
 - local c = math.floor(stack.qty/4)
 - local qty = c * 4
 - fetchSlot(slot, qty)
 - turtle.transferTo(2, c)
 - turtle.transferTo(5, c)
 - turtle.transferTo(6, c)
 - turtle.craft()
 - dropItems()
 - end
 - function scanChest()
 - chest.condenseItems()
 - local stacks = chest.getAllStacks()
 - for i,stack in ipairs(stacks) do
 - if isBrokenOre(stack) then
 - print("ORE: ", stack.name, " ", stack.id)
 - if stack.qty >= 4 then
 - makeGravel(i, stack)
 - end
 - else
 - -- transfer through
 - chest.pushItem(turtleDir, i, stack.qty)
 - dropItems()
 - print(" ", stack.name, " ", stack.id)
 - end
 - end
 - end
 - while true do
 - scanChest()
 - end
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment