Guest User

Raum

a guest
Oct 21st, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. j=0
  2.  
  3. function fforward()
  4.   while(turtle.forward()==false) do
  5.     turtle.dig()
  6.   end
  7. end
  8.  
  9. function fdigUp()
  10.   while(turtle.detectUp()) do
  11.     turtle.digUp()
  12.     sleep(0.4)
  13.   end
  14. end
  15.  
  16. function placeTorch()
  17.   turtle.turnRight()
  18.   turtle.turnRight()
  19.   turtle.select(2)
  20.   turtle.place()
  21.   turtle.turnRight()
  22.   turtle.turnRight()
  23.   j=0
  24. end
  25.  
  26. function step()
  27.   fforward()
  28.   fdigUp()
  29.   turtle.select(1)
  30.   turtle.placeDown()
  31.   if(j>12) then
  32.     placeTorch()
  33.   end
  34.   j=j+1
  35. end
  36.  
  37. write("Maximale Laenge eingeben:")
  38. max=tonumber(read())
  39. i=0
  40.  
  41. while(i<max) do
  42.   for k=1,i do
  43.     step()
  44.   end
  45.   turtle.turnRight()
  46.   i=i+2
  47. end
Add Comment
Please, Sign In to add comment