Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foods={"minecraft:carrot","minecraft:cooked_chicken","minecraft:pumpkin_pie","minecraft:bread","minecraft:baked_potato","minecraft:melon"}
- time={1.5, 3, 4, 2.5, 2.5, 1}
- lastfed=0
- inv=peripheral.wrap("top")
- while true do
- canfeed=false
- for j=1,#foods do
- for i=1,inv.size() do
- slotmeta=inv.getItemMeta(i)
- if slotmeta~=nil and slotmeta.name==foods[j] and turtle.getItemCount(j)<1 then
- inv.pushItems("down",i,1,j)
- break
- end
- end
- end
- for i=1,#foods do
- if turtle.getItemCount(i)>0 and lastfed~=i then
- canfeed=true
- break
- end
- end
- if canfeed then
- for j=1,#foods do
- if lastfed~=j and turtle.getItemCount(j)>0 then
- turtle.select(j)
- turtle.dropDown(1)
- lastfed=j
- sleep(time[j]+1)
- --break
- end
- end
- else
- sleep(10)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement