Guest User

melons

a guest
Dec 27th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. x=0
  2.  
  3. function findLength()
  4. while not turtle.detect() do
  5. turtle.forward()
  6. x=x+1
  7. end
  8. print("Length of melon farm:"..x)
  9. end
  10.  
  11. function harvest()
  12. for a=1,x do
  13. turtle.forward()
  14. if turtle.digDown() then
  15. print("Melon harvested...")
  16. end
  17. end
  18. end
  19.  
  20. function home()
  21. for b=1,x do
  22. turtle.back()
  23. end
  24. end
  25.  
  26. function deposit()
  27. d=1
  28. turtle.select(1)
  29. for c=1,2 do
  30. turtle.turnRight()
  31. end
  32. for g=1,8 do
  33. turtle.drop()
  34. d=d+1
  35. turtle.select(d)
  36. end
  37. turtle.select(1)
  38. for e=1,2 do
  39. turtle.turnRight()
  40. end
  41. end
  42.  
  43. f=1
  44.  
  45. findLength()
  46. home()
  47. while f==1 do
  48. harvest()
  49. home()
  50. deposit()
  51. end
Advertisement
Add Comment
Please, Sign In to add comment