Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SLOT_COUNT = 16
- local E_Orb = peripheral.wrap("bottom")
- function dropItems(orb)
- item = orb.getItemDetail(2)
- if(item == nil) then
- for slot = 1, SLOT_COUNT, 1 do
- local item = turtle.getItemDetail(slot)
- if(item ~= nil) then
- if (item["name"] == "minecraft:redstone_block") then
- turtle.select(slot)
- turtle.dropDown(2)
- else
- turtle.select(slot)
- turtle.dropDown(1)
- end
- end
- end
- return true
- else
- return false
- end
- end
- function handleResults(orb)
- working = true
- while (working) do
- resultSlot = orb.getItemDetail(1)
- if (resultSlot ~= nil) then
- turtle.select(16)
- turtle.suckDown()
- turtle.dropUp()
- turtle.select(1)
- working = false
- end
- end
- end
- while true do
- local event, p1 = os.pullEvent("turtle_inventory")
- local dropResult = dropItems(E_Orb)
- print(dropResult)
- if (dropResult) then
- handleResults(E_Orb)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement