Padhie

farming2

Mar 28th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- pastebin get RgVX49wJ farming2
  2. -- field spezification
  3. local iFelder = 15
  4. local iReihen = 6
  5. local iWasserReihe = 3
  6.  
  7. -- turtle spetification
  8. local iSamenSlot = 1
  9. local iKohleSlot = 2
  10.  
  11. local iF = 0
  12. local iR = 0
  13.  
  14. function nextLine(iAktuell)
  15. if iAktuell%2==0 then
  16. turtle.turnRight()
  17. turtle.forward()
  18. turtle.turnRight()
  19. else
  20. turtle.turnLeft()
  21. turtle.forward()
  22. turtle.turnLeft()
  23. end
  24. end
  25.  
  26. function checkFuel(iSamenSlot, iKohleSlot)
  27. iTankMin = 20
  28. if turtle.getFuelLevel() < iTankMin then
  29. iKohle = turtle.getItemCount(iKohleSlot)
  30. turtle.select(iKohleSlot)
  31. turtle.refuel(iKohle/2)
  32. turtle.select(iSamenSlot)
  33. end
  34. end
  35.  
  36. function goHome(iReihen, iFelder)
  37. if iReihen%2 == 0 then
  38. else
  39. turtle.turnRight()
  40. turtle.turnRight()
  41. while iFelder>=0 do
  42. turtle.forward()
  43. iFelder = iFelder-1
  44. end
  45. turtle.forward()
  46. end
  47. turtle.turnRight()
  48. while iReihen>0 do
  49. turtle.forward()
  50. iReihen = iReihen-1
  51. end
  52. turtle.turnRight()
  53. turtle.down()
  54. turtle.down()
  55. end
  56.  
  57. turtle.up()
  58. turtle.up()
  59. while iR<iReihen do
  60. while iF<=iFelder do
  61. if iReihe == iWasserReihe then
  62. else
  63. turtle.digDown()
  64. turtle.placeDown()
  65. end
  66. turtle.forward()
  67. iF = iF+1
  68. end
  69. if iR+1 == iReihen then
  70. else
  71. nextLine(iR)
  72. end
  73. iF = 1
  74. iR = iR+1
  75. checkFuel(iSamenSlot, iKohleSlot)
  76. end
  77. goHome(iReihen, iFelder)
  78. -- create by Padhie alias PaddyPadhie
Advertisement
Add Comment
Please, Sign In to add comment