Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function craft()
- fill=0
- for i=1,3 do
- if turtle.getItemCount(i)>0 then
- fill=fill+1
- end
- end
- for i=5,7 do
- if turtle.getItemCount(i)>0 then
- fill=fill+1
- end
- end
- for i=9,11 do
- if turtle.getItemCount(i)>0 then
- fill=fill+1
- end
- end
- print("fill= "..fill)
- if fill==9 then
- return turtle.craft()
- else
- return false
- end
- end
- local function suckUp(amount)
- for i=1,3 do
- turtle.select(i)
- turtle.suckUp(amount)
- end
- for i=5,7 do
- turtle.select(i)
- turtle.suckUp(amount)
- end
- for i=9,11 do
- turtle.select(i)
- turtle.suckUp(amount)
- end
- end
- local function suck(amount)
- for i=1,3 do
- turtle.select(i)
- turtle.suck(amount)
- end
- for i=5,7 do
- turtle.select(i)
- turtle.suck(amount)
- end
- for i=9,11 do
- turtle.select(i)
- turtle.suck(amount)
- end
- end
- local function clear()
- for i=1,16 do
- turtle.select(i)
- turtle.drop()
- end
- end
- local function clearUp()
- for i=1,16 do
- turtle.select(i)
- turtle.dropUp()
- end
- turtle.select(1)
- end
- mode=0
- amo=64
- while true do
- while mode==0 do
- print(amo)
- suck(amo)
- if craft() then
- turtle.dropUp()
- else
- if amo==1 then
- mode=1
- amo=64
- else
- amo=amo/2
- end
- clear()
- end
- end
- while mode==1 do
- print(amo)
- suckUp(amo)
- if craft() then
- turtle.dropUp()
- else
- if amo==1 then
- mode=0
- amo=64
- else
- amo=amo/2
- end
- clearUp()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment