Advertisement
MigasRocha

Farm de Batatas

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