Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- crafts = 2
- t=turtle
- j = crafts - 1
- l = 16 - crafts
- k = 16 - j
- function inv()
- t.select(1)
- if t.getItemCount(1) == 0 then
- t.suckUp()
- end
- end
- function transfer(k)
- t.select(1)
- if t.getItemCount(1) > 1 then
- for i=2,k do
- t.transferTo(i, 1)
- end
- end
- end
- function fill(i, crafts, l)
- t.select(i)
- for a=l,16 do
- if t.compareTo(a) == true then
- t.place()
- else
- sleep(0.2)
- end
- end
- end
- function fillM(crafts, j, l)
- for i = 1,l do
- if t.getItemCount(i) == 1 then
- fill(i, crafts, l)
- else
- if t.getItemCount(i) > 1 then
- t.select(i)
- if t.getSelectedSlot() < j then
- t.transferTo(i + 1, 1)
- else
- if t.getSelectedSlot() == j then
- t.select(i)
- t.transferTo(1, t.getItemCount(i) - 1)
- t.place()
- end
- end
- end
- end
- end
- end
- function main(crafts, j, k, l)
- inv()
- transfer(k)
- fillM(crafts, j, l)
- end
- while true do
- main(crafts, j, k, l)
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement