Advertisement
Juke2706

Test1

Feb 7th, 2013
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. local x, y = 1,1 --Quarry de 7*8
  2. function creuser()
  3.     local fuel, bd = turtle.getFuelLevel(), turtle.detect() --bd c'est le bloc devant
  4.     local b, g = 56, 56     --b c'est la couche de base et g c'est la couche actuelle
  5.     local v = b - g
  6.         while fuel > 100 do
  7.             turtle.digDown()
  8.             turtle.down()
  9.             g = g - 1
  10.                 if bd~=1 or bd~=2 or bd~=3 or bd~=13 then --apparamment problème à cette ligne: creuse les blocs de stone quand meme
  11.                     turtle.dig() --rajouter fonction tourner
  12.                 end
  13.                 if turtle.getItemCount(15) > 0 then
  14.                     turtle.up(v)
  15.                         if x == 1 or y == 4 then
  16.                             turtle.turnRight(2)
  17.                             turtle.forward(3)
  18.                             turtle.drop()
  19.                                 for i=2,16,1 do
  20.                                     if turtle.getItemCount(i) > 0 then
  21.                                         turtle.select(i)
  22.                                         turtle.drop(64)
  23.                                     end    
  24.                                 end
  25.                             turtle.turnRight()
  26.                             turtle.forward()
  27.                             turtle.turnLeft()
  28.                             turtle.select(1)
  29.                             turtle.suck(64)
  30.                             turtle.refuel(64)
  31.                             turtle.turnRight()
  32.                             turtle.forward()
  33.                             turtle.turnLeft()
  34.                             turtle.forward(3)
  35.                         end      
  36.                 end                    
  37.         end
  38.            
  39.        
  40.        
  41. end
  42. while x == 1 do
  43.     turtle.forward()
  44.     y = y + 1
  45.         if y == 4 then --endroit où creuser
  46.             creuser()
  47.         end
  48.         if y == 7 then
  49.             turtle.turnRight()
  50.             turtle.forward()
  51.             turtle.turnRight()
  52.             x = x + 1
  53.         end
  54. end
  55.     creuser()
  56.     y = 7
  57. while x == 2 do
  58.     turtle.forward()
  59.     y = y - 1
  60.         if y == 2 then --endroit où creuser
  61.             creuser()
  62.         end
  63.         if y == 1 then
  64.             turtle.turnLeft()
  65.             turtle.forward()
  66.             turtle.turnLeft()
  67.             x = x + 1
  68.         end
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement