Advertisement
Guest User

bite

a guest
Feb 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. e = 0
  2. x = 5
  3. z = 5
  4. ------------------
  5. state = 0
  6. statex = 0
  7. statez = 0
  8. startingpos = 1
  9. turtle.select(1);
  10. turtle.suckUp(64);
  11. turtle.select(2);
  12. turtle.suckUp(61);
  13.  
  14. function placeRight()                       --Commence a poser des blocks, tourne a droite
  15.   i = 0
  16.   while i < x-1 do
  17.     turtle.back()
  18.     place()
  19.     i = i + 1
  20.     print (i)
  21.   end
  22.   turtle.turnRight()
  23.   turtle.back()
  24.   place()
  25.   turtle.turnRight()
  26. end
  27.  
  28. function placeLeft()                        --Commence a poser des blocks, tourne a droite
  29.   i = 0
  30.   while i < x-1 do
  31.     turtle.back()
  32.     place()
  33.     i = i + 1
  34.     print (i)
  35.   end
  36.   turtle.turnLeft()
  37.   turtle.back()
  38.   place()
  39.   turtle.turnLeft()
  40. end
  41.  
  42. function place()                            --place des blocks
  43.   if turtle.getItemCount(1) > 0 then
  44.     turtle.place()
  45.     turtle.select(1)
  46.   else turtle.select(2)
  47.     turtle.place()
  48.   end
  49. end
  50. ----------------
  51. function position()                         --Se met en position
  52.  e = 0
  53.  turtle.dig()
  54.  print (s)
  55.  while  e < x+startingpos do
  56.   turtle.forward()
  57.   print (e)
  58.   e = e + 1
  59.  end
  60.  
  61.  turtle.turnLeft()
  62.  e = 0
  63.  while e < x-1 do                           --Se met en position
  64.  turtle.forward()
  65.  e = e + 1
  66.  end
  67.  
  68. end
  69.  
  70. position()
  71. startingpos=0
  72.  
  73. while statez < z do
  74.   while statex < x do
  75.     if state == 0 then
  76.       placeRight()
  77.       state = 1
  78.     else
  79.       placeLeft()
  80.       state = 0
  81.     end
  82.     statex = statex + 1
  83.   end
  84.   turtle.digUp()
  85.   turtle.up()
  86.   turtle.turnLeft()
  87.   statez = statez + 1
  88.   if statez < z then
  89.   position()
  90. end
  91.   statex = 0
  92.   state = 0
  93. end
  94. e = 0
  95. turtle.select(3)
  96. while e < z+1 do
  97.   turtle.placeUp()
  98.   turtle.down()
  99.   e = e + 1
  100. end
  101. turtle.back()
  102. turtle.place()
  103.  
  104. -- 2HrQXhEq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement