Advertisement
Guest User

branch

a guest
Mar 25th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. function digit()
  2.  while turtle.detect() do
  3.     turtle.dig()
  4.      os.sleep(0.5)
  5.   end
  6.   turtle.forward()
  7.  while turtle.detectDown() or turtle.detectUP() do
  8.    turtle.digUp()
  9.    turtle.digDown()
  10.   end
  11.  end
  12.  funtion placeTorch()
  13.      turtle.down()
  14.      turtle.back()
  15.      turtle.select(16)
  16.      turtle.placeUp()
  17.      turtle.forward()  
  18.      turtle.up()
  19.  end
  20.  local run = 0
  21.  local j = 0
  22.  local k = 0
  23.  
  24.  term.write("Branch lenght:  ")
  25.  run = read()
  26.  
  27.  for i = 1, run do
  28.   k = i - 1
  29.   j = k % 10
  30.   if j -- 1 then
  31.       placeTorch()
  32.   end
  33.    digit()
  34.    
  35.    turtle.down()
  36.    turtle.select(16)
  37.    turtle.placeUp()
  38.    turtle.turnRight()
  39.    turtle.turnRight()
  40.    for i = 1 run do
  41.    turtle forward()
  42. end
  43.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement