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 itemsDroppable(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
- return true
- end
- end
- else
- return false
- end
- end
- function dropItems(orb)
- 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
- end
- function handleResults(orb)
- while true do
- resultSlot = orb.getItemDetail(1)
- if (resultSlot ~= nil) then
- turtle.select(16)
- turtle.suckDown()
- turtle.dropUp()
- turtle.select(1)
- break
- end
- end
- end
- function getLoops(orb)
- item = orb.getItemDetail(2)
- maxLoops = 0
- if(item == nil) then
- for slot = 1, SLOT_COUNT, 1 do
- local item = turtle.getItemDetail(slot)
- if(item ~= nil) then
- if (item["count"]) then
- maxLoops = item["count"]
- end
- end
- end
- end
- return maxLoops
- end
- while true do
- --local event, p1 = os.pullEvent("turtle_inventory")
- if (itemsDroppable(E_Orb)) then
- dropItems(E_Orb)
- handleResults(E_Orb)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement