Advertisement
Guest User

farm

a guest
Jul 21st, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. shell.run("clear")
  2. front = read(16)
  3.  
  4. shell.run("clear")
  5. right = read(8)
  6.  
  7. shell.run("clear")
  8. print("ok, will do master!")
  9.  
  10. front = front - 1
  11. right = right - 1
  12.  
  13. turtle.forward()
  14. turtle.digDown()
  15. turtle.placeDown()
  16.  
  17. function line()
  18.   for i=1,front do
  19.     turtle.forward()
  20.     turtle.digDown()
  21.     turtle.placeDown()
  22.   end
  23. end
  24.  
  25. LR = 0
  26.  
  27. function square()
  28.   for i=1,right do
  29.  
  30.     LR = LR + 1
  31.    
  32.     if LR == 1 then
  33.       line()
  34.       turtle.turnRight()
  35.       turtle.forward()
  36.       turtle.turnRight()
  37.       turtle.digDown()
  38.       turtle.placeDown()
  39.     elseif LR == 2 then
  40.       line()
  41.       turtle.turnLeft()
  42.       turtle.forward()
  43.       turtle.turnLeft()
  44.       turtle.digDown()
  45.       turtle.placeDown()
  46.       LR = 0
  47.     end
  48.   end
  49. end
  50.  
  51. square()
  52. line()
  53.  
  54. turtle.turnRight()
  55.  
  56. if LR == 0 then
  57.   turtle.turnRight()
  58.   for i=1,front do
  59.     turtle.forward()
  60.   end
  61.   turtle.turnRight()
  62. end
  63.  
  64. for i=1,right do
  65.   turtle.forward()
  66. end
  67.  
  68. turtle.turnLeft()
  69. turtle.forward()
  70. turtle.turnRight()
  71. turtle.turnRight()
  72.  
  73. m = 1
  74.  
  75. for i=1,15 do
  76.   m = m + 1
  77.   turtle.select(m)
  78.   turtle.dropDown()
  79. end
  80.  
  81. turtle.select(1)
  82. shell.run("clear")
  83. print("I'm done master!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement