Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local itemCount = 1
- local input = ...
- itemCount = input
- function goHome()
- local condition = true
- local success1,reading1
- while condition do
- success1,reading1 = turtle.inspectUp()
- if success1 and reading1["name"]=="EnderStorage:enderChest" then
- condition = false
- else
- turtle.back()
- end
- end
- end
- function empty()
- for j=1,16 do
- turtle.select(j)
- turtle.dropDown()
- end
- end
- function refill()
- while turtle.getFuelLevel() < 10000 do
- turtle.select(1)
- turtle.suckUp(1)
- turtle.refuel()
- end
- end
- function pulse()
- redstone.setOutput("right",true)
- sleep(1)
- redstone.setOutput("right",false)
- sleep(1)
- end
- local slots = {1,2,3,5,6,7,9,10,11}
- local i = 1
- while i <= itemCount do
- goHome()
- empty()
- refill()
- print("run: "..i)
- for key,value in ipairs(slots) do
- turtle.forward()
- local success,reading = turtle.inspectUp()
- if success then
- turtle.select(value)
- while turtle.getItemCount(value) == 0 do
- pulse()
- sleep(1)
- turtle.suckDown(1)
- end
- end
- end
- turtle.forward()
- turtle.craft()
- empty()
- i=i+1
- end
Add Comment
Please, Sign In to add comment