Advertisement
MigasRocha

Farm de cenouras

Jul 4th, 2021
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. function refuel()
  2.  
  3.     if turtle.getFuelLevel() < 50 then
  4.         turtle.select(16)
  5.         turtle.placeUp()
  6.         turtle.suckUp()
  7.         turtle.refuel()
  8.         turtle.dropUp()
  9.         turtle.digUp()
  10.         turtle.select(1)
  11.     end
  12. end
  13.  
  14. function base()
  15.  
  16.         turtle.up()
  17.         turtle.turnRight()
  18.  
  19.     for frente1 =0,34 do
  20.         turtle.forward()
  21.     end
  22.    
  23.         turtle.turnRight()
  24.  
  25.     for frente2 =0,8 do
  26.         turtle.forward()
  27.     end
  28.  
  29.     for baixo =0,6 do
  30.         turtle.down()
  31.     end
  32.  
  33.         turtle.turnLeft()
  34.         turtle.turnLeft()
  35.  
  36.     for cima =0,6() do
  37.         turtle.up()
  38.     end
  39.  
  40.     for frente3 =0,8 do
  41.         turtle.forward()
  42.     end
  43.  
  44.     turtle.turnLeft()
  45.  
  46.     for frente4 =0,34 do
  47.         turtle.forward()
  48.     end
  49.  
  50.         turtle.turnRight()
  51.         turtle.down()
  52. end
  53.  
  54. while true do
  55.     for frente =0,9 do
  56.         local sucess, data = turtle.inspect()
  57.         if sucess == true then
  58.             if data.state.age == 7 then
  59.                 turtle.dig()
  60.                 turtle.place()
  61.             end
  62.         end
  63.         turtle.turnLeft()
  64.         turtle.forward()
  65.         turtle.turnRight()
  66.     end
  67.        
  68.         refuel()
  69.         turtle.turnRight()
  70.  
  71.     for tras =0,9 do
  72.         turtle.forward()
  73.     end
  74.  
  75.     turtle.turnLeft()
  76.  
  77.     if turtle.getItemCount() >= 1 then
  78.        base()
  79.     end
  80. end
  81.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement