Henness

HoneyMaker

Jul 30th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. local apiary = peripheral.wrap("right")
  2. local chest = peripheral.wrap("top")
  3.  
  4. local function resetApiary()
  5.     local outputs = apiary.getAllStacks()
  6.     for slot = 3, 9 do
  7.         local output = outputs[slot]
  8.         if output ~= nil then
  9.             if output.rawName == "item.beeprincessge" then
  10.                 apiary.pushItem("down", slot)
  11.                 apiary.pullItem("down", 1)
  12.                 print("Placed Princess in slot 1")
  13.             elseif output.rawName == "item.beedronege" then
  14.                 if apiary.getStackInSlot(slot).qty > 1 then
  15.                     apiary.pushItemIntoSlot("up", slot, apiary.getStackInSlot(slot).qty - 1)
  16.                 end
  17.                 apiary.pushItem("down", slot)
  18.                 apiary.pullItem("down", 1)
  19.                 print("Placed Drone in slot 2")
  20.             else
  21.                 apiary.pushItem("up", slot, 64, 0)
  22.                 print("Placed Comb in chest")
  23.             end
  24.         end
  25.     end
  26. end
  27.  
  28. while true do
  29.     if apiary.getStackInSlot(1) == nil then
  30.         resetApiary()
  31.         chest.condenseItems()
  32.     end
  33.     sleep(1)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment