Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- mark 2
- function refuel()
- if turtle.getFuelLevel() <= 1000 and turtle.getItemCount(16) > 0 then
- turtle.select(16)
- turtle.refuel()
- end
- turtle.select(1)
- end
- function start()
- turtle.select(1)
- turtle.down()
- turtle.dig()
- turtle.forward()
- end
- function firstline()
- while turtle.digUp() do
- turtle.dig()
- turtle.up()
- end
- while turtle.detectDown() == false do
- turtle.down()
- end
- end
- function secondline()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- firstline()
- end
- function dump()
- turtle.back()
- turtle.turnLeft()
- turtle.turnLeft()
- for slot = 1 , 14 do
- turtle.select(slot)
- turtle.drop()
- end
- end
- function checkfuel()
- if turtle.getItemCount(16) == 0 then
- turtle.turnLeft()
- turtle.select(16)
- turtle.suck()
- turtle.turnRight()
- turtle.turnRight()
- else
- turtle.turnRight()
- end
- end
- function checksap()
- if turtle.getItemCount(15) <= 4 then
- turtle.select(15)
- turtle.forward()
- turtle.suck()
- turtle.back()
- turtle.turnRight()
- else
- turtle.turnRight()
- end
- end
- function replant()
- turtle.select(15)
- turtle.forward()
- turtle.place()
- turtle.back()
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.place()
- turtle.back()
- turtle.place()
- end
- function wait()
- turtle.up()
- while turtle.detect() == false do
- sleep(5)
- end
- end
- function routine()
- start()
- refuel()
- firstline()
- secondline()
- dump()
- checkfuel()
- checksap()
- replant()
- wait()
- end
- while true do
- routine()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement