Advertisement
Mowmaster

Livingwood/stone Turtle Program

Mar 13th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. i=1
  2. j=1
  3. k=1
  4.  
  5. function ReFuel()
  6.   turtle.select(15)
  7.   turtle.suckDown(1)
  8.   turtle.refuel()
  9.   turtle.select(1)
  10. end
  11.  
  12. function Place()
  13. i=1
  14. repeat
  15.   turtle.placeUp()
  16.   turtle.forward()
  17.   i=i+1
  18. until i==3
  19. end
  20.  
  21. function Circle()
  22.   Place()
  23.   turtle.turnRight()
  24.   Place()
  25.   turtle.turnRight()
  26.   Place()
  27.   turtle.turnRight()
  28.   Place()
  29.   turtle.turnRight()
  30. end
  31.  
  32. function Dig()
  33. i=1
  34. repeat
  35.   turtle.digUp()
  36.   turtle.forward()
  37.   i=i+1
  38. until i==3
  39. end
  40.  
  41. function Square()
  42.   Dig()
  43.   turtle.turnRight()
  44.   Dig()
  45.   turtle.turnRight()
  46.   Dig()
  47.   turtle.turnRight()
  48.   Dig()
  49.   turtle.turnRight()
  50. end
  51.  
  52. function Stone()
  53.   turtle.turnLeft()
  54.   turtle.select(1)
  55.   turtle.suck(8)
  56.   turtle.turnRight()
  57.   Circle()
  58.   sleep(120)
  59.   Square()
  60.   Dump()
  61. end
  62.  
  63. function Wood()
  64.   turtle.turnRight()
  65.   turtle.turnRight()
  66.   turtle.suck(8)
  67.   turtle.turnLeft()
  68.   turtle.turnLeft()
  69.   Circle()
  70.   sleep(120)
  71.   Square()
  72.   Dump()
  73. end
  74.  
  75. function Dump()
  76.   turtle.forward()
  77.   turtle.select(1)
  78.   turtle.dropDown()
  79.   turtle.select(1)
  80.   turtle.back()
  81. end
  82.  
  83. function run()
  84. ReFuel()
  85. j=1
  86. repeat
  87.   Stone()
  88.   Wood()
  89.   j=j+1
  90. until j==5
  91. end
  92.  
  93. repeat
  94.   run()
  95. until k==2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement