Advertisement
meuced

farmWheat

Oct 17th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. function dropAndPlant()
  2.  
  3.     local graine = turtle.getItemCount(2)
  4.     if graine > 0 then
  5.         turtle.select(2)
  6.         turtle.place()
  7.         if graine > 10 then
  8.             turtle.dropUp(graine-10)
  9.         end
  10.     end
  11.     turtle.select(1)
  12.     turtle.dropUp()
  13.  
  14. end
  15.  
  16. while true do
  17.     for i=1,4 do
  18.         local success, ble = turtle.inspect()
  19.         if (success == true) and (ble.state.age == 7) then
  20.             turtle.select(1)
  21.             turtle.dig()
  22.             dropAndPlant()
  23.         elseif (success == false) then
  24.             dropAndPlant()
  25.         end
  26.         turtle.turnRight()
  27.         i = i+1
  28.         sleep(0.1)
  29.     end
  30.     sleep(300)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement