Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=0
- function findLength()
- while not turtle.detect() do
- turtle.forward()
- x=x+1
- end
- print("Length of melon farm:"..x)
- end
- function harvest()
- for a=1,x do
- turtle.forward()
- if turtle.digDown() then
- print("Melon harvested...")
- end
- end
- end
- function home()
- for b=1,x do
- turtle.back()
- end
- end
- function deposit()
- d=1
- turtle.select(1)
- for c=1,2 do
- turtle.turnRight()
- end
- for g=1,8 do
- turtle.drop()
- d=d+1
- turtle.select(d)
- end
- turtle.select(1)
- for e=1,2 do
- turtle.turnRight()
- end
- end
- f=1
- findLength()
- home()
- while f==1 do
- harvest()
- home()
- deposit()
- end
Advertisement
Add Comment
Please, Sign In to add comment