Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function home()
- while true do
- while turtle.forward() do
- end
- turtle.turnLeft()
- local success, data = turtle.inspectDown()
- if success and data.name=="ironchest:iron_chest" then
- turtle.turnLeft()
- return
- end
- end
- end
- local function load()
- turtle.select(1)
- for i=1,4 do
- turtle.suckDown()
- end
- end
- local function unload(f)
- for i=1,4 do
- turtle.forward()
- turtle.select(f[i][1])
- turtle.dropDown(f[i][2])
- turtle.forward()
- turtle.turnRight()
- end
- for i=1,4 do
- turtle.select(i)
- turtle.dropDown()
- end
- end
- home()
- while true do
- load()
- if turtle.getItemCount(4)>0 then
- unload({{1,64},{2,64},{3,64},{4,64}})
- sleep(10)
- elseif turtle.getItemCount(3)>0 then
- unload({{1,64},{2,64},{3, math.ceil(turtle.getItemCount(3)/2) },{3,64}})
- sleep(10)
- elseif turtle.getItemCount(2)>0 then
- unload({{1, math.ceil(turtle.getItemCount(1)/2) },{1,64},{2, math.ceil(turtle.getItemCount(2)/2) },{2,64}})
- sleep(10)
- elseif turtle.getItemCount(1)>0 then
- unload({ {1, math.ceil(turtle.getItemCount(1)/4) },
- {1, math.ceil(turtle.getItemCount(1)/4) },
- {1, math.ceil(turtle.getItemCount(1)/4) },
- {1,64}
- })
- sleep(10)
- else
- sleep(10)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement