Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. local alto = 6
  2. local ancho = 8
  3.  
  4. function recargar()
  5.     turtle.select(1)
  6.     if turtle.getItemCount() == 0 then
  7.         print("sin combustible")
  8.         turtle.down()
  9.         exit()
  10.     else
  11.         turtle.refuel(1)
  12.         turtle.select(2)
  13.     end
  14. end
  15.  
  16. function plantarAlto()
  17.     for i=1,alto do
  18.         turtle.placeDown()
  19.         if i ~= alto then
  20.             turtle.forward()
  21.         end
  22.     end  
  23. end
  24.  
  25. print("empezamos")
  26. if turtle.getFuelLevel() < 50 then
  27.     recargar()
  28.    
  29.     for i=1,ancho do
  30.         plantarAlto()
  31.        
  32.         if (ccount % 2 == 0) then
  33.             turtle.turnLeft()
  34.             turtle.forward()
  35.             turtle.turnLeft()
  36.         else
  37.             turtle.turnRight()
  38.             turtle.forward()
  39.             turtle.turnRight()
  40.         end
  41.  
  42.     end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement