Guest User

startup

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