Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chestFull = false
- function fillSlot(slot)
- turtle.select(slot)
- while turtle.getItemCount() < 16 do
- turtle.suck(16-turtle.getItemCount())
- end
- end
- function emptyInventory()
- for i=1,16 do
- turtle.select(i)
- item = turtle.getItemDetail()
- if item and item.name == "ic2:blockgenerator" then
- dropped, message = turtle.drop()
- if not dropped then
- chestFull = true
- return
- else
- chestFull = false
- end
- end
- end
- end
- function craftGenerator()
- turtle.select(2)
- while turtle.getItemCount() < 16 do
- turtle.suckUp(16-turtle.getItemCount())
- end
- turtle.turnLeft()
- fillSlot(6)
- turtle.turnRight()
- turtle.turnRight()
- fillSlot(10)
- turtle.craft()
- turtle.turnLeft()
- emptyInventory()
- end
- while true do
- while redstone.getInput("back") and not chestFull do
- emptyInventory()
- if not chestFull then
- craftGenerator()
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement