Advertisement
Guest User

Untitled

a guest
May 30th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. local N = 4
  2. local function recharge()
  3.     turtle.select(1)
  4.     print(turtle.getFuelLevel())
  5.     if turtle.getFuelLevel() < 4 then
  6.         turtle.refuel(1)
  7.     end
  8. end
  9.  
  10. function Dig(n)
  11.     while n > 0 do
  12.         turtle.dig()
  13.         n=n-1
  14.     end
  15. end
  16.  
  17. function creuse()
  18.     recharge()
  19.     Dig(N)
  20.     turtle.select(3)
  21.     turtle.placeDown()
  22.     turtle.select(1)
  23.     turtle.forward()
  24.     turtle.turnLeft()
  25.     Dig(N)
  26.     turtle.turnRight()
  27.     turtle.turnRight()
  28.     Dig(N)
  29.     turtle.turnLeft()
  30.     turtle.digUp()
  31.     turtle.up()
  32.     turtle.turnLeft()
  33.     Dig(N)
  34.     turtle.turnRight()
  35.     turtle.turnRight()
  36.     Dig(N)
  37.     turtle.turnLeft()
  38.     turtle.down()
  39. end
  40.  
  41. function light()
  42.     turtle.select(2)
  43.     turtle.turnRight()
  44.     turtle.turnRight()
  45.     turtle.place()
  46.     turtle.turnRight()
  47.     turtle.turnRight()
  48.     turtle.select(1)
  49. end
  50.  
  51. print("Creuse v3.0")
  52. local count = ...
  53. count = count + 1
  54. while count > 0 do
  55.     creuse()
  56.     if count%8 == 0 then
  57.         light()
  58.     end
  59.     count = count - 1
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement