assasin172

turtler

Nov 2nd, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function digF()
  2.     while not turtle.forward() do
  3.         turtle.dig()
  4.     end
  5. end
  6.  
  7. function digU()
  8.     while not turtle.up() do
  9.         turtle.digUp()
  10.     end
  11. end
  12.  
  13. function digD()
  14.     while not turtle.down() do
  15.         turtle.digDown()
  16.     end
  17. end
  18.  
  19. function detectU()
  20.     while turtle.detectUp() do
  21.         turtle.digUp()
  22.     end
  23. end
  24.  
  25. function detectD()
  26.     while turtle.detectDown() do
  27.         turtle.digDown()
  28.     end
  29. end
  30.  
  31. function tF()
  32.     while turtle.getFuelLevel()==0  do
  33.         turtle.refuel()
  34.     end
  35. end
  36.  
  37. function rL()
  38.     while not turtle.detect() do
  39.         turtle.turnLeft()
  40.     end
  41. end
  42.  
  43. function rR()
  44.     while turtle.detectRight() do
  45.         turtle.turnRight()
  46.         turtle.dig()
  47.     end
  48. end
  49.  
  50. print("Enter lenght vaule of corridor")
  51. local lenght=read()/2
  52.  
  53. for i=1,lenght do
  54. tF()
  55. digF()
  56. digU()
  57. digF()
  58. digD()
  59. end
Advertisement
Add Comment
Please, Sign In to add comment