BruceWplays

Lauren Farm 2

Jun 21st, 2022 (edited)
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.03 KB | None | 0 0
  1. done = 0
  2. for l=1,10 do
  3. if fs.exists("goto") == false
  4. then do
  5. print("downloading goto")
  6. shell.run("pastebin","get","9wbmJhWS","goto")
  7. end
  8. else do
  9. while true do
  10. if done ~= 4 then do
  11. --CHANGE HERE START
  12. lenth = 5
  13. st_width = 5
  14. --CHANGE HERE END
  15.  
  16.                        
  17. function chest()                        
  18.                        
  19. shell.run("goto", "359", "88", "629")
  20.  
  21.     chest = 2
  22.     while chest ~= 17 do
  23.        if turtle.detectDown() == true then                        
  24.     print("chest: " .. chest)
  25.     turtle.select(chest)
  26.     turtle.dropDown()
  27.     chest = chest + 1
  28.  elseif turtle.detectDown() == false then
  29.        turtle.down()                          
  30.                                 end  
  31.    sleep(45)
  32.    os.reboot()                        
  33.  end                              
  34.                                
  35.                                
  36.                                
  37. function turn()
  38.                                    
  39. if right == 1 then
  40.                                     print("right")
  41. turtle.turnRight()
  42. turtle.forward()
  43. turtle.turnRight()
  44. turtle.forward()
  45. dist = lenth
  46. width = width - 1
  47. right = 0
  48. else
  49.                                     print("left")
  50. turtle.turnLeft()
  51. turtle.forward()
  52. turtle.turnLeft()
  53. turtle.forward()
  54. dist = lenth
  55. width = width - 1
  56. right = 1
  57. end
  58. end
  59.  
  60. shell.run("goto", "355", "89", "631")
  61.  
  62.  
  63. shell.run("goto", "359", "89", "629")
  64. turtle.turnRight()
  65. right = 1
  66. turtle.select(1)
  67. dist = lenth
  68.  
  69. turtle.forward()
  70. turtle.forward()
  71. if width == 0 or width == nil  then
  72.  done = done + 1
  73.       print ("add")                      
  74.     print ("Steps: " .. done)
  75.   if done == 4 then
  76.                                 chest()
  77.                                   done = 0
  78.                                     end
  79.  
  80. width = st_width
  81.                             print("width: " .. width)
  82.  elseif width ~= 0 then
  83.                                
  84.                            
  85.                            
  86. if dist ~= 0 then                          
  87.            
  88.                          
  89. if done == 1 then
  90.  
  91.    while width ~= 0 do                                
  92.     while dist ~= 0 do
  93.        success, data = turtle.inspectDown()  
  94.          if success then                                    
  95.                                             print("Age: " .. data.state.age)
  96.                                            
  97.      if data.state.age == 7 then
  98.            print("Age Check 2: " .. data.state.age)                                          
  99.         turtle.digDown()
  100.                                                    
  101.               end
  102.                 end                                
  103.                   turtle.forward()
  104.          print ("Steps: " .. done)  
  105.                                                
  106. print("dig")
  107.        dist = dist - 1
  108.                                                    
  109.              
  110.          end                              
  111.    turn()
  112.    
  113.        end                            
  114.  
  115. elseif done == 2 then
  116.                                    
  117.    while width ~= 0 do                                  
  118.     while dist ~= 0 do
  119.         turtle.suckDown()
  120.         turtle.forward()
  121.                                     print("grab")
  122.                                             print ("Steps: " .. done)  
  123.        dist = dist - 1
  124.        end
  125.        turn()                                
  126.     end
  127.                                        
  128.  
  129. elseif done == 3 then
  130.    
  131.    while width ~= 0 do                                
  132.     while dist ~= 0 do
  133.         turtle.placeDown()
  134.         turtle.forward()
  135.        print("plant")
  136.             print ("Steps: " .. done)                                  
  137.    dist = dist - 1
  138.        end
  139.        turn()                                      
  140.     end
  141.                                    
  142.  
  143.  end
  144.  
  145.                                     end
  146.  
  147.  
  148.                                
  149.  
  150.  
  151.  
  152.  
  153. end
  154. end
  155. end
  156. end                    
  157. end                    
  158.     end                
  159.     end                
Add Comment
Please, Sign In to add comment