Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turnLeft = false
- function checkSlots()
- for i=2,16 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- break;
- end
- print("Ran out of filling material, noob!")
- end
- end
- function checkFuel()
- if turtle.getFuelLevel() < 100 then
- turtle.select(1)
- if not turtle.refuel(turtle.getItemCount(1)) then
- print("Ran out of fuel, noob!")
- end
- end
- end
- while true do
- while turtle.forward() do
- turtle.placeDown()
- checkSlots()
- checkFuel()
- end
- if(turnLeft) then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- checkSlots()
- turtle.placeDown()
- turnLeft = false
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- checkSlots()
- turtle.placeDown()
- turnLeft = true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement