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:itembatre" then
- dropped, message = turtle.drop()
- if not dropped then
- chestFull = true
- return
- else
- chestFull = false
- end
- end
- end
- end
- function craftBattery()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(2)
- while turtle.getItemCount() < 16 do
- turtle.suckUp(16-turtle.getItemCount())
- end
- fillSlot(5)
- fillSlot(7)
- fillSlot(9)
- fillSlot(11)
- turtle.turnRight()
- fillSlot(6)
- fillSlot(10)
- turtle.craft()
- turtle.turnRight()
- emptyInventory()
- end
- while true do
- while not chestFull do
- emptyInventory()
- if not chestFull then
- craftBattery()
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement