Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findBlock()
- for slot = 2,16 do
- if turtle.getItemCount(slot) >0 then
- turtle.select(slot)
- break
- end
- end
- end
- function move()
- turtle.forward()
- turtle.placeDown()
- findBlock()
- end
- function refuel()
- turtle.select(1)
- turtle.refuel()
- end
- function turnRight()
- findBlock()
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- end
- function turnLeft()
- findBlock()
- turtle.turnLeft()
- turtle.forward()
- turtle.placeDown()
- turtle.turnLeft()
- end
- function run()
- for i=1,59 do
- if turtle.getFuelLevel() < 1 then
- refuel()
- else
- move()
- end
- end
- end
- while true do
- findBlock()
- run()
- turnRight()
- run()
- turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment