Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lane=0
- sleep(2)
- function fuelup()
- if turtle.getFuelLevel()<=2000 then
- print("Getting fuel")
- turtle.down()
- turtle.down()
- turtle.select(1)
- turtle.suckDown()
- turtle.refuel()
- turtle.up()
- turtle.up()
- end
- end
- function empty()
- turtle.down()
- turtle.down()
- for x=1,16 do
- turtle.select(x)
- turtle.dropDown()
- print("Emptied slot",x)
- end
- turtle.up()
- turtle.up()
- end
- function theend()
- if turtle.detect() then
- turtle.turnRight()
- if turtle.detect() then
- print("Found the end")
- empty()
- turtle.turnRight()
- turtle.turnRight()
- while turtle.detect()==false do
- turtle.forward()
- end
- turtle.turnLeft()
- lane=0
- fuelup()
- print("5 second cooldown")
- sleep(5)
- else
- turtle.forward()
- turtle.suckUp()
- turtle.turnRight()
- end
- else
- turtle.turnLeft()
- end
- end
- function collect()
- while true do
- print(lane)
- lane=lane+1
- turtle.suckUp()
- turtle.forward()
- if turtle.detect() and lane%2~=0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.suckUp()
- turtle.turnLeft()
- elseif turtle.detect() and lane%2==0 then
- if lane>60 then
- print("Checking for end of path")
- theend()
- else
- turtle.turnRight()
- turtle.forward()
- turtle.suckUp()
- turtle.turnRight()
- end
- end
- end
- end
- collect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement