Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function nextSlot()
- n = turtle.getSelectedSlot() + 1
- if n > 16 then n = 1 end
- turtle.select(n)
- os.sleep(0.1)
- end
- function checkBucket()
- if turtle.getItemDetail(turtle.getSelectedSlot()) == nil then return false end
- return true
- end
- function getMilk()
- if not checkBucket() then
- itr = 0
- while not checkBucket() do nextSlot() itr = itr+1 end
- if itr > 20 then
- write("Sleep 10s after ")
- write(itr)
- print(" iterates")
- os.sleep(10)
- end
- end
- return turtle.place()
- end
- c=0
- while true do
- os.sleep(0.1)
- os.queueEvent("randomEvent")
- os.pullEvent()
- if(redstone.getInput("back")) then
- os.sleep(60)
- else
- if getMilk() then c=c+1 end
- write(c)
- print(" B of milk collected")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement