Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function refuelAllSlot()
- for i = 1,16 do
- if(turtle.getItemCount(i)>0)then
- turtle.select(i)
- turtle.refuel(i)
- end
- end
- print("FuelLevel: "..turtle.getFuelLevel())
- end
- function haveItems(slot)
- if(turtle.getItemCount(slot)<1)then
- print("No have items in "..slot.." slot!")
- end
- while(turtle.getItemCount(slot)<1)do
- os.sleep(0.5)
- end
- end
- function inventoryFull()
- if(turtle.getItemCount(16)>0)then
- turtle.select(1)
- turtle.placeDown()
- for i=3,16 do
- if(turtle.getItemCount(i)>0)then
- turtle.select(i)
- turtle.dropDown()
- end
- end
- turtle.select(3)
- end
- end
- refuelAllSlot()
- count=0
- while(turtle.getFuelLevel()>0)do
- haveItems(1)
- haveItems(2)
- if(turtle.detect())then
- turtle.dig() end
- if(turtle.detectUp())then
- turtle.digUp() end
- if(turtle.detectDown())then
- turtle.digDown() end
- if(not(turtle.detect()))then
- if(count>11)then
- count=2
- turtle.select(2)
- turtle.placeDown()
- end
- inventoryFull()
- turtle.forward()
- end
- count=count+1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement