Advertisement
trentboys

lua computaar

Apr 9th, 2021
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 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. function placeTorch()
  13.   turtle.down()
  14.   turtle.back()
  15.   turtle.select(16)
  16.   turtle.forward()
  17.   turtle.up()
  18. end
  19.  
  20. local run = 0
  21. local j = 0
  22. local k = 0
  23.  
  24. term.write("Branch Length: ")
  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. end
  35.  
  36. turtle.down()
  37. turtle.select(16)
  38. turtle.placeUp()
  39. turtle.turnRight()
  40. turtle.turnRight()
  41.  
  42. for i = 1 run do
  43.   turtle.foward()
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement