Advertisement
Guest User

pure

a guest
Jan 24th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. local seedsReady = false
  2.  
  3. local function checkForSeeds()
  4.   local itemsFound = 0
  5.   for i = 1, 12 do
  6.     itemsFound = itemsFound + turtle.getItemCount(i)
  7.   end
  8.   if itemsFound > 0 then
  9.  
  10.         seedsReady = true
  11.   else
  12.     seedsReady = false
  13.   end
  14. end
  15.  
  16. local function checkSeedStatus()
  17.  
  18.   turtle.suckDown()
  19.   for i = 1, 12 do
  20.     turtle.select(i)
  21.     for j = 13, 16 do
  22.       if turtle.compareTo(j) then turtle.dropUp() end
  23.     end
  24.   end
  25. end
  26.  
  27.  
  28. while true do
  29.  
  30.   checkForSeeds()
  31.   if seedsReady then
  32.  
  33.     redstone.setOutput("front", true)
  34.     for i = 1, 12 do
  35.      
  36.       turtle.select(i)
  37.       turtle.dropDown()
  38.     end
  39.  
  40.     os.sleep(15)
  41.     checkSeedStatus()
  42.   else
  43.     redstone.setOutput("front", false)
  44.     os.sleep(6)
  45.     checkSeedStatus()
  46.   end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement