Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.wrap("bottom")
- local jarSide= "top"
- local aspect = "herba"
- local tSlot = 1
- local chestToTurtle = "up"
- --local cableSide = "bottom"
- function fullJarSlot()
- local as = chest.getAllStacks(false)
- for slot,content in pairs(as) do
- if content.name == "BlockJarFilledItem" then
- return slot
- end
- end
- return 0
- end
- function placeFullJar()
- local placed = false
- while placed == false do
- turtle.select(tSlot)
- while turtle.getItemCount(tSlot) < 1 do
- local fjs= fullJarSlot()
- if fjs > 0 then
- chest.pushItemIntoSlot(chestToTurtle,fjs,1,tSlot)
- end
- sleep(2)
- end
- while not turtle.detectUp() do
- turtle.select(tSlot)
- placed=turtle.placeUp()
- sleep(4)
- end
- sleep(4)
- end
- end
- while true do
- for i = 1,16 do
- if turtle.getItemCount(i) > 0 then
- turtle.dropDown()
- end
- end
- if turtle.detectUp() then
- local level = peripheral.call(jarSide,"getAspectCount",aspect)
- if level == 0 then
- print("Jar is empty")
- turtle.select(tSlot)
- turtle.digUp()
- turtle.dropDown(1)
- else
- print("Jar not empty yet...")
- sleep(8)
- end
- else
- print("No jar detected")
- placeFullJar()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment