CCHacker132

Bee_Keeping

Feb 6th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --config
  2. local hiveName = 'minecraft:pamapiary_0'
  3. local presserName = 'minecraft:pampresser_3'
  4. local outputName = 'minecraft:chest_6'
  5. local networkName = 'turtle_24'
  6.  
  7. --
  8.  
  9. local hive = peripheral.wrap(hiveName)
  10. local presser = peripheral.wrap(presserName)
  11. local output = peripheral.wrap(outputName)
  12.  
  13. if not hive then
  14.     error('Hive not found!')
  15. end
  16. if not presser then
  17.     error('Presser not found!')
  18. end
  19. if not output then
  20.     error('Output not found!')
  21. end
  22.  
  23. local function collection()
  24.     while true do
  25.         sleep(0.05)
  26.         for num = 1,18 do
  27.             local meta = hive.getItemMeta(num)
  28.             if meta and meta.rawName == 'item.queenbeeitem' then
  29.                 hive.pushItems(networkName,1)
  30.                 hive.pullItems(networkName,1,1,19)
  31.             elseif meta and meta.rawName == 'item.grubitem' then
  32.                 hive.pushItems(outputName,num)
  33.             elseif meta then
  34.                 hive.pushItems(presserName,num,1,1)
  35.             end
  36.         end
  37.        
  38.         for num = 2,3 do
  39.            presser.pushItems(outputName,num)
  40.         end
  41.     end
  42. end
  43.  
  44. collection()
Add Comment
Please, Sign In to add comment