Advertisement
fbMarcel

| farm | wheat

Jan 6th, 2021 (edited)
974
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("######################")
  4. print("##  Farming Turtle  ##")
  5. print("######################")
  6. print("")
  7. print(" farming wheat...")
  8. function vor(x)
  9.   for i=1,x do
  10.     turtle.forward()
  11.   end
  12. end
  13. function tl()
  14.   turtle.turnLeft()
  15.   turtle.forward()
  16.   turtle.turnLeft()
  17.   turtle.digDown()
  18.   turtle.placeDown()
  19. end
  20. function tr()
  21.   turtle.turnRight()
  22.   turtle.forward()
  23.   turtle.turnRight()
  24.   turtle.digDown()
  25.   turtle.placeDown()
  26. end
  27. function fdp(x)
  28.   for i=1,x do
  29.     turtle.forward()
  30.     turtle.digDown()
  31.     turtle.placeDown()
  32.   end
  33. end
  34. turtle.up()
  35. turtle.forward()
  36. turtle.digDown()
  37. sleep(0.5)
  38. local slotnr = 1
  39. while true do
  40.   if turtle.getItemDetail(slotnr).name == "minecraft:wheat_seeds" then
  41.     turtle.select(slotnr)
  42.     break
  43.   else
  44.     slotnr = slotnr + 1
  45.   end
  46.   if slotnr == 16 then
  47.     print("error L1-ln37")
  48.     break
  49.   end
  50. end
  51. turtle.placeDown()
  52. fdp(19)
  53. tl()
  54. fdp(19)
  55. tr()
  56. fdp(19)
  57. tl()
  58. fdp(19)
  59. turtle.forward()
  60. turtle.turnRight()
  61. vor(2)
  62. turtle.turnRight()
  63. fdp(20)
  64. tl()
  65. fdp(19)
  66. tr()
  67. fdp(19)
  68. tl()
  69. fdp(19)
  70. turtle.forward()
  71. turtle.down()
  72. turtle.turnLeft()
  73. vor(8)
  74. for i=1,16 do
  75.   turtle.select(i)
  76.   turtle.drop()
  77. end
  78. turtle.select(1)
  79. turtle.turnLeft()
  80. print("")
  81. print(" DONE!")
  82. sleep(1)
  83. os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement