Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Farmer
- os.loadAPI("bldng/lib")
- status="start"
- lap=false
- xd=1
- yd=1
- lib.fstd({xd=xd,yd=yd,lap=lap,status=status})
- function setStatus(str)
- status=str
- fsave({status=status,xd=xd,yd=yd,lap=lap})
- end
- function plant()
- if turtle.detectDown() and lib.getFBlockdatad().state.age==7 then
- turtle.digDown()
- lib.setItem("seed",1)
- turtle.select(1)
- turtle.placeDown()
- end
- end
- if(lib.isResumed()) then
- xd=tonumber(lib.fload("xd"))
- yd=tonumber(lib.fload("yd"))
- lap=lib.tobool(lib.fload("lap"))
- status=lib.fload("status")
- plant()
- end
- lib.registerRunning(shell.getRunningProgram())
- while not lib.shouldret() do
- if lib.atSpawn() and status~="start" then
- setStatus("start")
- lib.clearInv()
- sleep(3600)
- end
- if status=="start" or status=="start2" then
- while not turtle.inspect() do
- lib.move(xd,0,0)
- plant()
- end
- setStatus("wall")
- end
- if status=="wall" then
- lib.rotate(lib.getMoveDir(0,yd))
- if turtle.inspect() then
- if yd<0 then
- yd=1
- else
- yd=-1
- end
- end
- lib.move(0,yd,0)
- setStatus("turn")
- end
- if status=="turn" then
- plant()
- if xd<0 then
- xd=1
- else
- xd=-1
- end
- lib.rotate(lib.getMoveDir(xd,0))
- setStatus("start2")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment