Advertisement
Guest User

digAuto

a guest
Feb 13th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. print("How much i must dig?")
  2. total = tonumber(read())
  3. long = 0
  4. torch = 0
  5. while true do
  6.   if total > long then
  7.     turtle.dig()
  8.     turtle.forward()
  9.     turtle.digUp()
  10.     long = (long + 1)
  11.     torch = (torch + 1)
  12.     if torch == 4 then
  13.       turtle.select(16)
  14.       turtle.back()
  15.       turtle.placeUp()
  16.       turtle.forward()
  17.       torch = 0
  18.     end
  19.     bloc = turtle.detectDown()
  20.     if not bloc then
  21.       turtle.select(15)
  22.       turtle.placeDown()
  23.     end
  24.   else
  25.     return
  26.   end
  27.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement