CCHacker132

Bee_Keeping_Multi

Feb 7th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --config
  2. local presserName = 'minecraft:pampresser_0'
  3. local presser2Name = 'minecraft:pampresser_1'
  4. local outputName = 'minecraft:chest_0'
  5. local networkName = 'turtle_0'
  6.  
  7. --
  8. local hives = {peripheral.find('minecraft:pamapiary')}
  9. local presser = peripheral.wrap(presserName)
  10. local presser2 = peripheral.wrap(presser2Name)
  11. local output = peripheral.wrap(outputName)
  12.  
  13. if not presser then
  14.     error('Presser not found!')
  15. end
  16. if not presser2 then
  17.     error('Second presser not found!')
  18. end
  19. if not output then
  20.     error('Output not found!')
  21. end
  22. if #hives == 0 then
  23.     error('No hives detected!')
  24. end
  25.  
  26. local function collection()
  27.     while true do
  28.         sleep(0.05)
  29.         for i,hive in ipairs(hives) do
  30.         for num = 1,18 do
  31.             local meta = hive.getItemMeta(num)
  32.             if meta and meta.rawName == 'item.queenbeeitem' then
  33.                 hive.pushItems(networkName,1)
  34.                 hive.pullItems(networkName,1,1,19)
  35.             elseif meta and meta.rawName == 'item.grubitem' then
  36.                 hive.pushItems(outputName,num)
  37.             elseif meta then
  38.                 if meta.rawName == 'item.honeycombitem' then
  39.                     hive.pushItems(presserName,num,1,1)
  40.                 else
  41.                     hive.pushItems(presser2Name,num,1,1)
  42.                 end
  43.             end
  44.         end
  45.         end
  46.         for num = 2,3 do
  47.            presser.pushItems(outputName,num)
  48.            presser2.pushItems(outputName,num)
  49.         end
  50.     end
  51. end
  52.  
  53. collection()
Add Comment
Please, Sign In to add comment