Advertisement
MigasRocha

Test Cenoura Farm

Jun 10th, 2024 (edited)
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. x = 0
  2.  
  3. while true do
  4.  
  5.  
  6. function check_G()
  7.  
  8. local sucess, data = turtle.inspect()
  9.  
  10. if sucess == true then
  11.     if data.state.age == 8 then
  12.         turtle.dig()
  13.         turtle.place()
  14.         print("Ready to Harvest")
  15.     else
  16.         print("Not Ready to Harvest")
  17.     end
  18. end
  19.     end
  20.  
  21.  
  22. function home()
  23.  
  24. turtle.turnLeft()
  25.  
  26.     for homeP = 1,5 do
  27.         turtle.forward()
  28.     end
  29.         turtle.turnRight()
  30.         x = x+1
  31.         print(x)
  32. end
  33.  
  34.  
  35. function path()
  36.  
  37.     for line = 1,5 do
  38.  
  39.         check_G()
  40.         turtle.select(1)
  41.         turtle.turnRight()
  42.         turtle.forward()
  43.         turtle.turnLeft()
  44.     end
  45. end
  46.  
  47.         path()
  48.         home()
  49.    
  50.     if x == 1 or 2 then
  51.         turtle.up()
  52.         turtle.up()
  53.        
  54.         if x == 3 then
  55.             turtle.down()
  56.             turtle.down()
  57.             turtle.down()
  58.             turtle.down()
  59.             turtle.down()
  60.             x = 0
  61.         end
  62.        
  63.     end
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement