Advertisement
Punio

oreberry turtle

Jul 12th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. height = 10
  2.  
  3. function farmUp()
  4.   for i = 1, height do
  5.     turtle.select(1)
  6.     if turtle.compareDown() then
  7.       turtle.digDown()
  8.     end
  9.    
  10.     turtle.up()  
  11.  
  12.     while not turtle.placeDown() do
  13.       sleep(1)
  14.     end
  15.  
  16.     sleep(3)
  17.  
  18.     if turtle.detectUp() then
  19.       break
  20.     end
  21.   end
  22. end
  23.  
  24. function farmDown()
  25.   for i = 1, height do
  26.     if turtle.compareDown() then
  27.        turtle.digDown()
  28.     end  
  29.    
  30.     turtle.down()
  31.        
  32.     while not turtle.placeDown() do
  33.       sleep(1)
  34.     end
  35.    
  36.     sleep(3)
  37.   end
  38. end
  39.  
  40. function check()
  41.   turtle.select(2)
  42.   for i= 1,4 do
  43.     turtle.turnLeft()
  44.     if turtle.compare() then
  45.       turtle.turnLeft()
  46.       turtle.turnLeft()
  47.       break
  48.     end
  49.   end
  50. end
  51.  
  52. function deploy()
  53.   turtle.turnLeft()
  54.   turtle.turnLeft()
  55.   for i = 3, 16 do
  56.     if turtle.getItemCount(i) > 0 then
  57.       turtle.select(i)
  58.       while not turtle.drop() do
  59.         sleep(1)
  60.       end
  61.     end
  62.   end
  63.   turtle.turnLeft()
  64.   turtle.turnLeft()
  65. end
  66.  
  67. check()
  68.  
  69. while true do
  70.   farmUp()
  71.   farmDown()
  72.   deploy()
  73.   sleep(30)
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement