Advertisement
Ezteyh

cannesucre

Jun 14th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.53 KB | None | 0 0
  1. local det
  2. local c = 0
  3.  
  4. function detup()
  5.  if turtle.detectUp() then
  6.   det = 1
  7.   c = c + 1
  8.  else
  9.  det = 0
  10.  end
  11. end
  12.  
  13.  
  14. function dig()
  15.  turtle.digDown()
  16.  turtle.dig()
  17.  turtle.forward()
  18.  print(c)
  19. end
  20.  
  21. function detupdig()
  22.  detup()
  23.  dig()
  24.  detup()
  25.  print(c)
  26. end
  27.  
  28. function go1()
  29.  while (c == 0 or c == 1
  30.  or c == 3 or c == 5
  31.  or c == 7 or c == 9
  32.  or c == 11 or c == 13
  33.  or c == 15 or c == 17
  34.  or c == 19) do
  35.   detupdig()
  36.   print(c)
  37.  end
  38. end
  39.  
  40. function sharpleft()
  41.  while (c == 2 or c == 6 or c == 10 or c == 14 or c == 18) do
  42.   turtle.turnLeft()
  43.   dig() turtle.digDown()
  44.   turtle.dig() turtle.down() turtle.dig() turtle.up()
  45.   turtle.turnLeft()
  46.   c = c + 1
  47.   print(c)
  48.  end
  49. end
  50.  
  51. function largeright()
  52.  while (c == 4 or c == 8 or c == 12 or c == 16) do
  53.   turtle.turnRight()
  54.   dig()dig()
  55.   turtle.turnRight()
  56.   dig()dig()
  57.   c = c + 1
  58.   print(c)
  59.  end
  60. end
  61.  
  62. function home()
  63.  while (c == 20) do
  64.   turtle.turnLeft()
  65.   detupdig()
  66.  end
  67.  
  68.  while
  69.  (c == 21) or (c == 22)
  70.  or (c == 23) or (c == 24)
  71.  or (c == 25) or (c == 26)
  72.  or (c == 27) do
  73.   detupdig()
  74.  end
  75.  print(c)
  76. end
  77.  
  78. function vider()
  79.   turtle.turnRight()
  80.   turtle.forward()
  81.   turtle.turnLeft()
  82.   turtle.forward()
  83.   turtle.down()
  84.   for i = 1,16 do
  85.    turtle.select(i)
  86.    turtle.drop()
  87.   end
  88.   turtle.select(1)
  89.   turtle.up()
  90.   turtle.turnLeft()
  91. end
  92.  
  93. while true do
  94.  
  95. go1()
  96. sharpleft()
  97. largeright()
  98. home()
  99. while c == 28 do
  100.  vider()
  101.  c = -1
  102. end
  103.  
  104. while c == -1 do
  105.  detupdig()
  106.  print(c)
  107. end
  108. print(c)
  109.  
  110. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement