Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chest=peripheral.wrap("left")
- blastdir="east"
- while true do
- os.pullEvent("redstone")
- if rs.getInput("top") then
- local inventory=chest.getAllStacks()
- local irontotal=0
- local ironloc={}
- for i,j in pairs(inventory) do
- if j.name=="Iron Ingot" then
- irontotal=irontotal+j.qty
- ironloc[#ironloc+1]=i
- end
- end
- local pushIron=math.floor(irontotal/9)
- local ironKey=1
- for i=1,9 do
- toPush=pushIron
- while toPush>0 do
- toPush=toPush-chest.pushItem(blastdir,ironloc(ironKey),toPush,11-i)
- ironKey=ironKey+1
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment