Advertisement
akihex

apothecary

Jan 15th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. local drop = turtle.drop
  2.  
  3. --local signal = true
  4. local function toggle(onOff)
  5. --  signal = not signal
  6.   rs.setOutput("bottom",onOff)
  7. end
  8.  
  9. local function searchSeed()
  10.   local item = nil
  11.   for i=1,16 do
  12.     item = turtle.getItemDetail(i)
  13.     if item and item.name == "minecraft:wheat_seeds" then return true end
  14.     if not item then return false end
  15.   end
  16.   return false
  17. end
  18.  
  19. local function checkNWait()
  20.   while not searchSeed() do
  21.     local event = os.pullEvent("turtle_inventory")
  22.   end
  23.   return searchSeed()
  24. end
  25.  
  26. local function dropIngredients()
  27.   local i = 1
  28.   local done = false
  29.   local item = nil
  30.   while i < 17 and turtle.getItemCount(i) > 0 and not done do
  31.     turtle.select(i)
  32.     item = turtle.getItemDetail(i)
  33.     if item and item.name == "minecraft:wheat_seeds" then done = true end
  34.     turtle.drop(1)
  35.     i = i + 1
  36.   end
  37. end
  38.  
  39. toggle(true)
  40. while true do
  41.   print("Insert seeds as _last_ ingredient")
  42.   checkNWait()
  43.   dropIngredients()
  44.   sleep(0.5)
  45.   toggle(false)
  46.   sleep(5)
  47.   toggle(true)
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement