SHARE
TWEET

minar

a guest Jul 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function checkFuel()
  2.  while turtle.getFuelLevel() < 20 do
  3.   turtle.select(16)
  4.   turtle.refuel(1)
  5.   turtle.select(1)
  6.  end
  7. end
  8.  
  9. function minar()
  10.  while not turtle.forward() do
  11.   turtle.dig()
  12.  end
  13. end
  14.  
  15. function minarAbajo()
  16.  while not turtle.down() do
  17.   turtle.digDown()
  18.  end
  19. end
  20.  
  21. function minarArriba()
  22.  while not turtle.up() do
  23.   turtle.digUp()
  24.  end
  25. end
  26.  
  27. function chunk()
  28.  for i = 0, 4 do
  29.   checkFuel()
  30.   minar()
  31.  end
  32.  
  33.  minarArriba()
  34.  turtle.turnLeft()
  35.  turtle.turnLeft()
  36.  
  37.  for i = 0, 4 do
  38.   checkFuel()
  39.   minar()
  40.  end
  41.  
  42.  minarArriba()
  43.  turtle.turnLeft()
  44.  turtle.turnLeft()
  45. end
  46.  
  47. print("Bienvenido a capitalismineitor")
  48. print("Introduzca el largo del tunel: ")
  49. local largo = read()
  50. local numchunks = 4
  51.  
  52.  
  53. for i = 0, largo do
  54.  checkFuel()
  55.  minar()
  56.  turtle.turnRight()
  57.  
  58.  for j = 0, numchunks do
  59.   chunk()
  60.  end
  61.  
  62.  for i = 0, 4 do
  63.   checkFuel()
  64.   minar()
  65.  end
  66.  
  67.  turtle.turnLeft()
  68.  turtle.turnLeft()
  69.  
  70.  for i = 0, 4 do
  71.   minar()
  72.  end
  73.  
  74.  turtle.turnRight()
  75.  
  76.  for i = 0, numchunks*2+1 do
  77.   minarAbajo()
  78.  end
  79. end
  80. print("Fin programa")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top